How to use checkbox to write an SQL statement? I select * to open all the data in my table. before each data entry, I add & lt; inputtype = checkbox & quot; & gt; after I select several checkbox points that I need to submit, how can I transfer the data I need to the specified page for processing? How to write SQL statements? Thank you for writing SQL statements in combination with checkbox.
I select * open all the data in my table. I added After I select several checkbox points that I need to submit, how can I transfer the data I need to the specified page for processing? How to write SQL statements? Thank you.
------ Solution --------------------
Print_r ($ _ POST); // the selected content will be included in the content.
------ Solution --------------------
PHP code
------ Solution --------------------
Each table has a primary key with a unique value.
Generally, the name is id.
You only need to pass this id, you can locate the record in the database through this id
After submission, $ _ POST ['box'] is an array composed of all selected IDs.
------ Solution --------------------
Discussion
If I want to pass the data obtained from the database corresponding to input, do I need to set the name parameter in input to the same name as the name of the data corresponding to the database?