In this way, we need to delete data from the data table in bulk, how to write the code ... Ask Daniel to guide the maze!
Reply to discussion (solution)
Delete tbl_name where ID in ($var 1, $var 2,...)
This is a $_post array, which submits multiple content in a form with $_post[] to PHP,
PHP gets $_post, with a foreach traversal of $_post, with "DELETE ' db_name ' WHERE id =". $_post[]
This is a $_post array, which submits multiple content in a form with $_post[] to PHP,
PHP gets $_post, with a foreach traversal of $_post, with "DELETE ' db_name ' WHERE id =". $_post[]
How to put the ID submitted in the form in an array ...
When you generate a checkbox, you can specify an array, and then commit it once.
Then traverse Delete or in () ... Delete all can
$_post itself is an array.
Every tag is a single input, right? Each of the input has a name value,
LZ after the check click Submit (Submit), $_post[' This is the name value of input '] will be submitted to the PHP page.
If you select it, True is not selected or false.
In the PHP page.
if ($_post[' input's name value ']) {
Echo ' I was chosen ';
Here to write MySQL DELETE statement
}
It would be nice to have a while on the outside of this if statement.
$_post itself is an array.
Every tag is a single input, right? Each of the input has a name value,
LZ after the check click Submit (Submit), $_post[' This is the name value of input '] will be submitted to the PHP page.
If you select it, True is not selected or false.
In the PHP page.
if ($_post[' input's name value ']) {
Echo ' I was chosen ';
Here to write MySQL DELETE statement
}
It would be nice to have a while on the outside of this if statement.
Actually, I don't need a while circulating fluid.
Include (".. /conn/conn.php "); $array = Implode (", ", $_post[' flags ']); $query =" Delete from Tbl_user where ID in ($array) "; $sql = Mysql_q Uery ($query); if ($sql) {echo "";} Else{echo "";}
The text box is written like this:
When you POST the past, get it on the server: $id = $_post[' id ']; which column you check to get the value of which column.