You are here: Re: [PHP] Using SELECT IN with arrays « PHP « IT news, forums, messages
Re: [PHP] Using SELECT IN with arrays

Posted by W Luke on 10/04/38 11:07

On Thu, 3 Feb 2005 08:37:44 +0800, Jason Wong <php-general@gremlins.biz> wrote:

> > $doms is a "master array" of a user's domains. $d is a
> > comma-seperated and unexploded list of domains to filter the SELECT
> > down with. (error checking is already in place)
>
> 1) make both $d and $doms into array
> 2) use array_intersect() to find the $d's that match $doms
> 3) convert the matches into a comma separated string with single quotes around
> the individual values
> 4) SELECT blah WHERE domain IN(comma separated string with single quotes
> around the individual values)

Wicked - thanks Jason

--
Will The Corridor of Uncertainty http://www.cricket.mailliw.com/
- Sanity is a madness put to good use -

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация