Selecting Rows Based on Row Values Being in Array

From: Date: Sat, 30 Jun 2007 05:18:54 +0000
Subject: Selecting Rows Based on Row Values Being in Array
Groups: php.general 
Request: Send a blank email to php-general+get-258002@lists.php.net to get a copy of this message
Hello All, I'm attempting to return rows from a mysql DB based on this criteria: I have a list, in the form of an array that I need to compare against each row in the table. Where theres a match I need that entire row returned. e.g. $varListof 3outOf_10Fields = array(6blue40lbs, 7orange50lbs, 8orange60lbs, 9purple70lbs); The array contains 3 of the db row fields in 1 value. However there are 10 fields/columns in the table. =============== what table looks like | =============== size color weight ROW 1 | value1 | value1 | value1 | value1 | value1 | value1 | So how could I set up a query that would SELECT the entire row, if the row contained $varListof 3outOf_10Fields[1]. Open to any suggestions or work arounds. I'm playing with extract() but code is too crude to even post.

« previous php.general (#258002) next »