Iinserting into 250 tables filtered data automaticly. delaytime??

From: Date: Sun, 30 Dec 2001 02:57:04 +0000
Subject: Iinserting into 250 tables filtered data automaticly. delaytime??
Groups: php.db 
Request: Send a blank email to php-db+get-15268@lists.php.net to get a copy of this message
Hi guys, I would like to split a table of 2.3mill entries into 250 single ones. They contain countrycodes and I created automaticly 250 tables named after this codes. So far so good... No I would like to insert via php the data into the tables. The problem is, that the querry takes to much time and the for loop requests the next one. So it does not work. Is there a delay function to make php wait for 3 min before proceeding, or does anybody have a better idea? Cheers Andy PS: Here is the code: $sql = " select country_code from countries "; $result2 = execute_stmt($sql, $link); // get the name of the country_code while ($row2 = mysql_fetch_object($result2)){ $cc[] = $row2->country_code; } // insert the specific data into the coresponding table for ($i=0; $i < count($cc); $i++){ $sql3=" insert into $cc[$i] select c.id, c.city, c.country_code, c.province from test_geo_cities c, countries co where c.country_code = '$cc[$i]' "; $result3 = execute_stmt($sql3, $link); };

« previous php.db (#15268) next »