I'm trying to fetch 5100 rows from a MySQL database to another. However, it seems that the script only fetches around 1300 and ends.
The script has two connections, one for each db. The code looks like:
$result = mysqli_query($con_remote,"SELECT * FROM product_images");
while($row = $result->fetch_assoc())
{
//Insert
mysqli_query($con_local,"INSERT INTO product_images (id, filename,
product_id) VALUES('$row[product_image_id]', '$row[product_image_filename]',
'$row[fk_product_id]')");
}
I have also added ini_set('max_execution_time', 800);
at the start of the script in order to avoid execution timeout. What could I improve/change to get all 5100 rows?
Edit: I ended up with exporting the remote database and import it to my local machine and then change the column names.