Re: where match question

From: Date: Tue, 23 Jan 2007 06:53:34 +0000
Subject: Re: where match question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-247607@lists.php.net to get a copy of this message
Don wrote:
I have a db field that contains zip codes separated by comas. I am trying to get php to return all of the rows that contain a particular zip code. $query = "SELECT * FROM info WHERE MATCH (partialZIP) AGAINST ('$zip')";
try this $query = "SELECT * FROM info WHERE column LIKE '{$zip}'";
$result = mysql_query($query) or die ("could not connect to db"); $row = mysql_fetch_row($result); this works if there is only one row that contains that zip code. If there is more than one row that contains the zip, it returns 0 rows. ('It' being MYSQL that returns 0 rows. I checked this by running the query directly to the DB) Any ideas are very much appreciated. Thanks, Don


« previous php.general (#247607) next »