In Php as we all know, there are no inbuilt controls by itself like Asp.Net’s GridView etc. I am using Html’s <table> to build up the grid and keep the row’s id in one hidden field. I’ve also placed one checkbox at the beginning of each row and a delete button at the bottom of the grid. The problem i face is, how do i get all the id’s that are checked so that i can pass those ids in my IN clause of Delete?
In Php as we all know, there are no inbuilt controls by itself like
Share
First you name all your checkboxes by suffixing
[]in their name so that an array gets created, later this is how you can get those that are checked and act accordingly:Where
checksis the name of all those checkboxes eg:And this is how you can get those for your
INclause in your query:Now you can use the
$valuesin yourINclause of your query.