php - MySQLi with OR condition array -
say array variable $i
contains serial numbers. example: $i=array("1", "15", "20", "23");
variable set $_post
.
and mysqli query such delete rows serial numbers exists in array. i.e. if serial number = 1 or 15 or 20 or 23, delete row. how write single mysqli prepared statement?
i tried foreach
, logic query n number of times, n size of array.
foreach($i $sno)// logic use { delete `table` `sno`=? bind_param("i", $sno); execute(); }
how can simplified query can re-written sno=[1] or [2] or [3] or ... [n]
Comments
Post a Comment