I got this delete query to work. It is from a form that puts the ID into an array. I am using a checkbox for each ID. Upon submitting, I pull the query below to delete all records with the ID. It works just fine!
<input name="ID[]" type="checkbox" id="ID[]" value="<? echo $row['ID']; ?>">
$del_id = mysql_real_escape_string(implode(',', $_POST['ID']));
$sqldelete = "DELETE FROM table WHERE ID IN($del_id)";
mysql_query($sqldelete,$connection) ;
However, I am failing at using a SELECT statement with a while loop.
My attempt:
$sqltrans = mysql_query("SELECT * FROM table WHERE ID IN($del_id)");
while($row= mysql_fetch_array($sqltrans)) {
$ID = $row['ID'];
}
Basically, I just get no return, not even an error message.
Any thoughts on why I'm not getting a result?
thanks!