] Selecting Rows Based on Row Values Being in Array
kvigor wrote:
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
Hello Master Coders,
This is working so far but I need to add an additional search.
This is what I have so far:
$in_list = '.join(',',$cen_chiefs).';
$query_cen_chiefs = SELECT * FROM central WHERE CONCAT(strName,'
',strCity,' ',strState) IN({$in_list}) ORDER BY conName;
I also
kvigor wrote:
where is the part that it join()'s things together?
it's: $in_list = '.join(',',$list).';
Good
what is the output of the join() call
it's: '7orange50lbs','8purple60lbs' //once echo'd
Fine
$query_One = SELECT * FROM shoe WHERE CONCAT(size,color,weight)
IN({$in_list});
Sorry,
That was a typo there's on one IN clause.
here is how it reads: SELECT * FROM central WHERE
CONCAT(strName,strCity,strState) IN('7orange50lbs','8purple60lbs').
So in my table I have 8 in size column, purple in color column, and 60lbs in
weight column.
Since the concatenated value will
kvigor wrote:
Sorry,
That was a typo there's on one IN clause.
here is how it reads: SELECT * FROM central WHERE
CONCAT(strName,strCity,strState) IN('7orange50lbs','8purple60lbs').
So in my table I have 8 in size column, purple in color column, and 60lbs in
weight column.
Since the
) it
worked. So what do I owe you?
- Original Message -
From: Jim Lucas [EMAIL PROTECTED]
To: kvigor [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Thursday, July 05, 2007 10:10 AM
Subject: Re: [PHP] Selecting Rows Based on Row Values Being in Array
kvigor wrote:
Sorry
,' ',strState) it
worked. So what do I owe you?
- Original Message - From: Jim Lucas [EMAIL PROTECTED]
To: kvigor [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Thursday, July 05, 2007 10:10 AM
Subject: Re: [PHP] Selecting Rows Based on Row Values Being in Array
kvigor wrote
where is the part that it join()'s things together?
it's: $in_list = '.join(',',$list).';
what is the output of the join() call
it's: '7orange50lbs','8purple60lbs' //once echo'd
$query_One = SELECT * FROM shoe WHERE CONCAT(size,color,weight)
IN({$in_list});
This is the results of $query_One:
kvigor wrote:
Ok Jim,
This is what I have so far and I'm still working it out.
$in_list = .join('',$someArrayList); // do I really need to concatenate
it needs to be
$in_list = '.join(',',$someArrayList).'; // you need the quotes!!
or separate anything here since my array values
Jim,
Thanks for all you help. Tell me where to mail you the check seriously.
If we get this right I'll owe you.
OK, the query string now looks like you said it would. However Query isn't
returning a match.
//DETAILS=
My $list array
kvigor wrote:
Jim,
Thanks for all you help. Tell me where to mail you the check seriously.
If we get this right I'll owe you.
OK, the query string now looks like you said it would. However Query isn't
returning a match.
//DETAILS=
kvigor wrote:
Jim,
Thanks for all you help. Tell me where to mail you the check seriously.
If we get this right I'll owe you.
OK, the query string now looks like you said it would. However Query isn't
returning a match.
//DETAILS=
Subject: Re: [PHP] Selecting Rows Based on Row Values Being in Array
kvigor wrote:
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
]
To: kvigor [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Saturday, June 30, 2007 1:46 AM
Subject: Re: [PHP] Selecting Rows Based on Row Values Being in Array
kvigor wrote:
Hello All,
I'm attempting to return rows from a mysql DB based on this criteria:
I have a list, in the form
I don't even being to understand your question, but it's a MySQL
question anyway.
http://dev.mysql.com/
On Sat, June 30, 2007 12:18 am, kvigor wrote:
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
PROTECTED] wrote in message
news:[EMAIL PROTECTED]
K. Hayes wrote:
Will do. Thanks.
- Original Message - From: Jim Lucas [EMAIL PROTECTED]
To: kvigor [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Saturday, June 30, 2007 1:46 AM
Subject: Re: [PHP] Selecting Rows Based on Row
kvigor wrote:
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 =
Will do. Thanks.
- Original Message -
From: Jim Lucas [EMAIL PROTECTED]
To: kvigor [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Saturday, June 30, 2007 1:46 AM
Subject: Re: [PHP] Selecting Rows Based on Row Values Being in Array
kvigor wrote:
Hello All,
I'm attempting
K. Hayes wrote:
Will do. Thanks.
- Original Message - From: Jim Lucas [EMAIL PROTECTED]
To: kvigor [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Saturday, June 30, 2007 1:46 AM
Subject: Re: [PHP] Selecting Rows Based on Row Values Being in Array
kvigor wrote:
Hello All
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,
20 matches
Mail list logo