[PHP-DB] RE: What's wrong with this QUERY?? - Thanks all.

2004-07-23 Thread Bob Sherer
Harmeet, The field email is obviously a field that can accept strings. In SQL, you must wrap strings in single-quotes. So, rewrite your query as: $query = SELECT id, email, familyname FROM members WHERE email='$thing'; The reason it worked for id=$thing is that the id field is probably an

[PHP-DB] Re: What's wrong with this QUERY?? - Thanks all.

2004-07-22 Thread Harry G
Thank you everybody. Harry G [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I have a database with members details and PK is id. $thing = [EMAIL PROTECTED]; $query = SELECT id, email, familyname FROM members WHERE email=$thing; $result = mysql_query($query); If i do a