I have made an output script, that outputs database tables, I've also added a checkbox to each row. the checkbox: echo "<input type='checkbox' name='teamcheck[]' value='".$data['team_id']."'>"; PHP: And the submit buttone: echo"<input type='submit' name='submit' value='Accept' class='button'>"; PHP: What code do I need in order to delete checked record id's from db when user hits "Submit" (I can do the mysql part myself). Thanks very much!
<?php if(isset($_POST['submit'])){ for($x=0;$x<count($_POST['teamcheck']);$x++){ $list .= ($x == count($_POST['teamcheck'])-1)?$_POST['teamcheck'][$x]:$_POST['teamcheck'][$x].','; } $query = 'DELETE FROM team_table WHERE team_id IN ('.$list.')'; mysql_query($query); } ?> PHP: