I appreciate your quick response, but I think the problem I'm having is in
the query. Is WHERE MATCH () the proper format to use for getting multiple
rows from the DB? Or is there something else I'm missing?


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/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to