The trick is your using the wrong ' instead you need ` ...
go away from kl;->' and go to `->123 ;)
The key above the (Tab) key, or the key next to the number 1 above the q.  
so ...
$query="SELECT * FROM bibleverses WHERE `used` = 0 ORDER BY RAND() 
When I first learned this also I was fooled and used ' instead of `.  But in 
some cases you don't need to use it also.
I hope this covers it!  Sorry if someone else has responded before me.  I might 
of been a bit slow! ;)



>From: "Ron Piggott" <[EMAIL PROTECTED]>
>Reply-To: "Ron Piggott" <[EMAIL PROTECTED]>
>To: "Webmaster" <[EMAIL PROTECTED]>
>CC: "PHP DB" <>
>Subject: [PHP-DB] Re: UPDATE command
>Date: Fri, 17 Jun 2005 23:47:31 -0400
>This is kind of interesting ...
>$query="SELECT * FROM quiettimequotation WHERE used = 0 ORDER BY 
>LIMIT 1";
>$query="SELECT * FROM bibleverses WHERE 'used' = 0 ORDER BY RAND() 
>doesn't!  Having the ' around used makes that select command fail --- 
>the UPDATE command requires it!
>Thanks for those of you who responded to my question below.  I am 
>mailing list for my web site that I am wanting each entry which is 
>selected from the database to only be used once and not be available 
>until the entire list has been used.  I needed the UPDATE command to 
>the used column all back to 0 again once the last entry had been 
>from the database.  I think I like programming mySQL stuff :)  Ron
> >Does the UPDATE command only change one row or each occurance if the 
> >criteria repeat itself through the table?
>PHP Database Mailing List (
>To unsubscribe, visit:

Send instant messages to your online friends 

Reply via email to