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]

you can use in

here logic,

delete table sno in ($i) 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -