NYCPHP Meetup

NYPHP.org

[nycphp-talk] OT: Quick MySQL Syntax Question

Anthony Papillion papillion at gmail.com
Mon Dec 5 22:45:47 EST 2005


Hello Everyone,

I know this is off-topic but this problem is driving me totally nuts and I
am hoping somone here will take a moment to answer this post:

I have a db table called 'sisters'. I am wanting to select ONE RANDOM record
from that table but I want to exclude a specific record from that random
selection. Here is the sql I'm using:

SELECT * FROM sisters WHERE email !='email_address_to_exclude' ORDER BY
RAND() LIMIT 1"

However, every time I insert my WHERE clause, I am told by MySQL that there
is an error in my syntax. I've replaced the != with NOT and it makes no
difference. Can anyone tell me what I'm doing wrong?

Thanks!
Anthony Papillion
Phone: (918) 926-0139
ICQ: 96-698-595

CAN ONE VOICE CHANGE THE WORLD?
http://www.one.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20051205/dc21b325/attachment.html>


More information about the talk mailing list