Re: where match question

From: Date: Tue, 23 Jan 2007 04:19:51 +0000
Subject: Re: where match question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-247597@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')"; $result = mysql_query($query) or die ("could not connect to db"); $row = mysql_fetch_row($result);
http://php.net/mysql_fetch_assoc has a better example. When there are many rows returned you need to loop to show them all: while ($row = mysql_fetch_assoc($result)) { print_r($row); } -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.general (#247597) next »