Hi there,
I have a list of integers which are in a php variable called $categoryID_list.
For example, the output of "print($categoryID_list);" is '8','9','10'.
I wanna make a query which looks like this:
$sql= mysql_query("SELECT distinct p.ID FROM products p,categories c WHERE p.ID>0 AND c.id IN ($categoryID_list)");
Then, the while($result = mysql_fetch_array($sql)) loop gives an error.
Anyway, when I type it in on the command prompt, the code below outputs the correct result:
SELECT distinct p.ID FROM products p,categories c WHERE p.ID>0 AND c.id IN ('8','9','10')
Sounds weird to me...
Any idea how to fix it?
Thanks in adavance!
Nobru