Re: Re: UPDATE command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"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";

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux