I currently have an array of values (business_id’s)
lets say its
Array
(
[0] => 12
[1] => 14
[2] => 15
)
What is the best way to use each of these value to get the associated row information for each business_id from the database.
Can it be one in one query is my question. Obviously, you could do
$q = "select * from business where business_id = 12";
$rs = mysql_query($q);
The usual SQL injection warnings still apply, you may want to loop through the ids first to validate or escape them. Also, if you expect strings instead of numbers, use this: