Re: What's wrong with this QUERY??

From: Date: Fri, 23 Jul 2004 03:23:54 +0000
Subject: Re: What's wrong with this QUERY??
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-35439@lists.php.net to get a copy of this message
--- Harry G <harry@gabha.net> wrote: > Hi, > > I have a database with members details and PK is id. > > $thing = "July22@gabha.net"; > > $query = "SELECT id, email, familyname FROM members > WHERE email=$thing"; Make it $query = "SELECT id, email, familyname FROM members WHERE email='$thing'"; It should work zareef ahmed > $result = mysql_query($query); > > If i do a query where id=$thing. > and $thing="20"; > this works fine and I get the desired result. But > what is wrong with the > other one, when I do search for the email address?? > > The email address does exist exactly as quoted above > in the "email" field in > my "members" table but still doesn't produce any > results. > > Any help is much appreciated. > > Harmeet > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > ===== Zareef Ahmed :: A PHP Developer in Delhi(India). Homepage :: http://www.zasaifi.com __________________________________ Do you Yahoo!? Vote for the stars of Yahoo!'s next ad campaign! http://advision.webevents.yahoo.com/yahoo/votelifeengine/

« previous php.db (#35439) next »