"Dieter Hansen" <[EMAIL PROTECTED]> wrote: > "Steve Werby" <[EMAIL PROTECTED]> schrieb am 28.11.01: > > "Steve Osborne" <[EMAIL PROTECTED]> wrote: > > > Simple question for one of you I am sure. I'm new to mysql (and php) and > > I > > > am hoping someone can explain exactly what the 'in_array' function does. > > I have to assume this is a PHP question since it has nothing to do with > > MySQL. Probably would be more suitable for the php-general list at php.net, > > but... > > > > 1. It returns true if a value is found in the supplied array, false > > otherwise. > > 2. See the PHP manual entry for in_array() for details and examples. > > http://us.php.net/manual/en/function.in-array.php > > Hi! > Is there a similiar function for MySql which could be used in a > WHERE-clause in a query like WHERE field in_array $thisstringarray.
SELECT * FROM table_name WHERE my_field IN ('dog','cat','mouse') will return all records where the value of my_field is in the set in the list above. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php