Re: Re: UPDATE command
| From: | Dwight Altman | Date: | Mon, 20 Jun 2005 14:37:04 +0000 |
| Subject: | Re: Re: UPDATE command | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-39721@lists.php.net to get a copy of this message | ||
"This is kind of interesting ...
$query="SELECT * FROM quiettimequotation WHERE used = 0 ORDER BY RAND()
LIMIT 1";
works;
$query="SELECT * FROM bibleverses WHERE 'used' = 0 ORDER BY RAND() LIMIT
1";
doesn't! Having the ' around used makes that select command fail ---
but
the UPDATE command requires it!"
Use the "`" mark around table names and field names.
Use the "'" mark around values.
Although sometimes you may get away without them.
$query="SELECT * FROM
bibleverses WHERE used = '0' ORDER BY
RAND()
LIMIT 1";