Jump to content

[SOLVED] Can't stop this query from looping


subnet_rx

Recommended Posts

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.