I have created a table and would like to insert multiple fields for each POST_ID in my POSTS table. I wrote a script but apparently it is too large of a task for the server to handle (my forum currently has 176,457 posts.) I dug around the dorebuildcontent script to try to reverse engineer it to suite my needs to no avail. Here is the code below I am working with:
PHP Code
$query = "
	select POST_ID
	from ubbt_POSTS
   ";
   $sth = $dbh -> do_query($query);
   $total = $dbh -> total_rows($sth);
   for($a=0;$a<$total;$a++){

	  list ($postid) = $dbh -> fetch_array($sth);
	$postrow[$a]['postid'] = $postid;

}

   for($a=0;$a<$total;$a++){
$query = "
	insert into ubbt_NEW_TABLE (POST_ID)
	values ({$postrow[$a]['postid']})
";
   $sth = $dbh -> do_query($query);
} 
How can I make this step through 200 posts at a time so it will work?