I have a form which displays multiple records each record has a check box in it, what I want to do is when submit button clicked it should insert selected records into mysql. I can do single insert but cannot think of how to get this done. Thanks
You can use something like this: <form> <input type="text" name="records[1]"/> <input type="text" name="records[2]"/> <input type="text" name="records[3]"/> </form> HTML: foreach($_REQUEST['records'] as $record ){ mysql_query("...."); } PHP:
Thanks for quick reply but what I am trying to do, have a select option when that is selected that record should be inserted.
if($_POST['record1']==1) { insert the stuff } if($_POST['record2']==1) { insert the stuff } if($_POST['record3']==1) { insert the stuff } Code (markup): just have if statements m8