Hi,
I want to split some numbers that are seperated by commars (,) and put them into an array.
I then want to select each record from a database which has the same id as the numbers in the array.
I think this would be done by a split, then a for or a while.
I'm not sure though... can someone help me out?
Thanks!
Array, database... help!
Moderator: General Moderators
if the numbers are separated by , the string is perfectly suited for expr IN (value,...) (http://www.mysql.com/doc/en/Comparison_Operators.html#IDX1118)
e.g.
e.g.
Code: Select all
$query = 'SELECT field FROM table WHERE id IN ('.$numbers.')';