SQL: $ SQL = deletefrom 'doing' whereidin ('1, 2, 3, 4 '); data is separated by commas. Form: formaction =? Action = doingmethod = postinputname = ID_Dele [] type = checkboxid = ID_Dele [] value = 1
SQL: $ SQL = "delete from 'doing' where id in ('1, 2, 3, 4 ')";
Data are separated by commas.
Form:
Good $ ID_Dele = $ _ POST ['id _ Dele '] will be an array. Although PHP is of a weak type, ASP is not weak here.
ASP can be directly:
SQL = "delete from [doing] where id in ('" & ID_Dele. However, PHP cannot directly include $ ID_Dele. Because $ ID_Dele is not '1, 2, 3, 4 ', because $ ID_Dele is an array with keys and values.
Well, it's not difficult in PHP. There's just a function: implode (), right. A function is the opposite of the split () \ explode () function. The latter two are separated by a certain character (such as a comma), and the former can be spliced as a string.
Therefore:
$ ID_Dele = implode (",", $ _ POST ['id _ dele']);
$ SQL = "delete from 'doing' where id in ($ ID_Dele )";