Selecting Rows Based on Row Values Being in Array
- From: k3cheese@xxxxxxxxxxxxx ("kvigor")
- Date: Sat, 30 Jun 2007 00:18:54 -0500
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.
.
- Follow-Ups:
- Re: [PHP] Selecting Rows Based on Row Values Being in Array
- From: Jim Lucas
- Re: [PHP] Selecting Rows Based on Row Values Being in Array
- Prev by Date: Re: mail function problem
- Next by Date: calling parent class method from the outside
- Previous by thread: Re: Handling animated GIFs with GD?
- Next by thread: Re: [PHP] Selecting Rows Based on Row Values Being in Array
- Index(es):
Relevant Pages
|