boo_lolly Posted November 21, 2006 Share Posted November 21, 2006 hey all! i've got a CMS i'm working on and i have a couple of HTML tables that are populated via php loops communicating with the SQL database. got it? good.at the end of each row in the HTML table there is a checkbox. i need to be able to click as many of them as i want, and then press "delete" and have them all be deleted, and then immediately returned to the exact same page.each HTML table row is exactly like the SQL row. each row has an ID, so that is probably the way i'd identify each row (it's worked for me so far =P).so can i get any advice, or direction. i'm almost positive i'm gonna have to store the value of the checkboxes in an array of somesort, somehow but i have NO idea where to even start. thanks! Quote Link to comment Share on other sites More sharing options...
Psycho Posted November 21, 2006 Share Posted November 21, 2006 For each checkbox name them in this manner[b]name=delete[] value=$recordID[/b]When you submit the form you will receive the value of $_POST[delete] as an array will all the boxes were checked. you could then just use a single delete query in the formDELETE FROM table WHERE record_id IN ([i]comma separated values[/i])I believe there is a command to convert an array into a comma separated list, otherwise you could just build it from the array. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.