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);
};
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]