Re: What's wrong with this QUERY??

From: Date: Fri, 23 Jul 2004 03:19:53 +0000
Subject: Re: What's wrong with this QUERY??
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-35438@lists.php.net to get a copy of this message
$thing = "July22@gabha.net"; $query = "SELECT id, email, familyname FROM members WHERE email=$thing";
You need to quote non-numeric values in SQL. It should be $query = "SELECT id, email, familyname FROM members WHERE email=''$thing'"; Also, you don't really need to select the email value since you should already have it. Larry

« previous php.db (#35438) next »