PHP array for an SQL “IN” clause?
<p>i am trying to search multiple roll numbers from database with html form e.g 2345,7654,8976 in a single field
now for php i am trying</p>

<pre><code>$query = "SELECT `firstname`, `lastname`, `roll`, `board`, `city` FROM `result` WHERE 1=1";

if(isset($_POST['mroll']))
{
$mroll=$_POST['mroll'];
$query.="and roll IN ('$mroll')";
}
</code></pre>

<p>but $_POST['mroll'] will be like this => 2345,7654,8976
for sql i have to quote them like this => '2345','7654','8976'
before using it in query
please help.</p>