Re: sql problem
| From: | Ignacio Vazquez-Abrams | Date: | Fri, 17 Nov 2000 02:53:57 +0000 |
| Subject: | Re: sql problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-25850@lists.php.net to get a copy of this message | ||
On Thu, 16 Nov 2000, Rodney Davis wrote:
> i can't figure out what is wrong with this query. Does
> anyone know why I get the error that follows the
> query?
>
> $ME is a global variable
>
> [snip]
> $ME = $SCRIPT_NAME;
>
> $qid = db_query("
> SELECT page_id
> FROM pageContent
> WHERE url = $ME
> ");
> [snip]
>
> and, I get the following error in the browser:
>
> [snip]
> Can't execute query
> SELECT page_id
> FROM pageContent
> WHERE url = /rtjdavis/index.php
>
> MySQL Error: You have an error in your SQL syntax near '/rtjdavis/index.php
> ' at line 4
>
> This script cannot continue, terminating.
> [snip]
>
> thanks,
> rodney
>
Put $ME in quotes.
--
Ignacio Vazquez-Abrams <ignacio@openservices.net>