I am a new in PHP, and I have some question regarding select statement using IN parameters.
<?php
$resultID = "333\n334\n335\n0";
$reconResult = str_replace("\n",",",$resultID);
//$reconResult will display 333,334,335,0
$query = mysql_query('SELECT * FROM tbl_name WHERE tbl_item_id IN($reconResult)');
if(mysql_num_rows($query)>0){
while($r=mysql_fetch_object($query)){
echo $r->tbl_item_name;
}
}
?>
I only want to display the items which contains id's from $reconResult;
Thanks in advance.