subnet_rx Posted August 27, 2007 Share Posted August 27, 2007 elseif ($_POST['event_name']) { $event_name = $vbulletin->input->clean_gpc('p', 'event_name', TYPE_NOHTML); $event_type = $vbulletin->input->clean_gpc('p', 'event_type', TYPE_NOHTML); $outcomes_no = $vbulletin->input->clean_gpc('p', 'outcomes_no', TYPE_NOHTML); $db->query_write("INSERT INTO picks_groups (group_title,type) VALUES ('".$db->escape_string($event_name)."','".$db->escape_string($event_type)."')"); $group_id = $db->insert_id(); for($i=1; $i<=$outcomes_no; $i++) { $outcomes[$i] = $vbulletin->input->clean_gpc('p', 'outcome[$i]', TYPE_NOHTML); } for($i=1, $i<=$outcomes_no; $i++ { $db->query_write("INSERT INTO picks_items (group_id, item_title) VALUES ('".$db->escape_string($group_id)."','".$db->escape_string($outcomes[$i])."')"); } } For some reason, my script times out trying to insert as many items as possible into the database on this specific line. for($i=1, $i<=$outcomes_no; $i++ { $db->query_write("INSERT INTO picks_items (group_id, item_title) VALUES ('".$db->escape_string($group_id)."','".$db->escape_string($outcomes[$i])."')"); } $outcomes_no is equal to 02. I checked it by echoing it, and it still will put 600,000+ items into the db. Anyone know what is going on? Quote Link to comment Share on other sites More sharing options...
subnet_rx Posted August 27, 2007 Author Share Posted August 27, 2007 This is pretty much solved. Changed the way I was putting the data in the array in the form, and it no longer loops. Still can't figure out why it wasn't stopping after 2 though. 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.