mysqli - How to migrate data from Table 1 to table 2 using php -


i want migrate data table 1 table 2

the same tables have same field_names , structure

i used query:

$sql1 = $mysqli->query("select * `table_1`"); while($data = $sql2->fetch_object()){     $sql2 = $mysqli->query("insert table_2 ('field_1','field_2','field_3') values('$data->value_1','$data->value_2','$data->value_3')"); } 

table_1 have 3000 records problem here query insert 700 records , gives me error message:

fatal error: maximum execution time of 30 seconds exceeded in d:\xampp\htdocs\assadara-group.com\t2t.php on line 3

put following line in start of php code
ini_set('max_execution_time', 0);

you can change 0 (mean unlimited time execution) number in seconds (300 = 5 minutes)

for more info. php manual http://php.net/manual/en/function.set-time-limit.php


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -