Re: Selecting Rows Based on Row Values Being in Array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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=========================================================

My $list array looks like this one echo'd:

$list[0] =7orange50lbs
$list[1] =8purple60lbs


Now when I do this:

$query_One= "SELECT * FROM shoe WHERE CONCAT(size,color,weight) IN({$in_list})";

$result = mysql_query($query_One,$connection) or die("Query failed: ". mysql_error($connection));
$row = mysql_fetch_assoc($result);

  while($row = mysql_fetch_assoc($result))

This should be:

$result = mysql_query($query_One,$connection) or die("Query failed: ". mysql_error($connection));

while($row = mysql_fetch_assoc($result))
....


Otherwise you're ignoring the first result every time (note I removed the first $row = mysql_fetch_assoc($result)).

Does the query work in mysql itself?

Echo it out and run it manually in phpmyadmin or something to make sure it does return what you need and doesn't produce an empty result set.

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux