Re: Single/Double Quotes
| From: | Konrad Riedel | Date: | Wed, 12 Dec 2001 19:21:06 +0000 |
| Subject: | Re: Single/Double Quotes | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-77545@lists.php.net to get a copy of this message | ||
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 within a set of double quotes, thus it
> was treated as a literal.
No, $aid is evaluated in both cases, but SQL-Syntax requires the quotes!
...WHERE aid = 'xyz'
Mit freundlichen Grüßen
Konrad Riedel