Am Wed, 12.Dec 2001 um 10:22 schrieb Miles Thompson:
> This should work ...
> $result=mysql_query("SELECT book FROM TAB_AUTHORS WHERE aid = '$aid'");
>
> When PHP sees the single quotes around the $aid it evaluates it to the
> value stored in the variable.
> Your first example connntained $aid
>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Wednesday, December 12, 2001 7:08 AM
Subject: [PHP] Single/Double Quotes
> Im tring to rewrite some code to use single/double quotes correctly (as
> correct as can be).
>
> If I use
> $result=mysql_query('SELECT
This should work ...
$result=mysql_query("SELECT book FROM TAB_AUTHORS WHERE aid = '$aid'");
When PHP sees the single quotes around the $aid it evaluates it to the
value stored in the variable.
Your first example connntained $aid within a set of double quotes, thus it
was treated as a literal.
Im tring to rewrite some code to use single/double quotes correctly (as
correct as can be).
If I use
$result=mysql_query('SELECT book FROM ' . TAB_AUTHORS . " WHERE aid =
$aid");
I get an mysql error. That should be correct, if I understand it right.
But if I use
$result=mysql_query('SELECT boo
4 matches
Mail list logo