hi,
I have this sql statement on form.php, thanks to this forum. I want to amend it but am having trouble understanding it. The form prior to this creates 2 empty textboxes on the fly.
I need to insert the same random number into the 'id' field next to every record inserted in the below statement.
Any ideas?
Code:
$sql.="INSERT INTO guests (guest_name, guest_email, event_id) VALUES";
for($i=0;$i<sizeof($_POST['username']);$i++){
$sql.="('".mysql_real_escape_string($_POST['username'][$i])."','".mysql_real_escape_string($_POST['email'][$i])."','".mysql_real_escape_string($_POST['id'][$i)."')";
if(!$i==sizeof($_POST['username'])){
$sql.=",";
}
}