On 1/23/07, Németh Zoltán <[EMAIL PROTECTED]> wrote:
On h, 2007-01-22 at 22:53 -0800, Jim Lucas wrote:
> 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}'";
I would use
$query = "SELECT * FROM info WHERE LOCATE('{$zip}', column) > 0";
And how are you going to index that? That's going to be extremely slow
as the size of the table grows.
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php