-1
<?php
require('DB.class.php');
//$conexao = mysql_connect('xxx.xxx.xxx.xxx','base_dados','utilizador');
//$db = mysql_select_db('base_dados',$conexao);
$SQl_list = DB::getConn()->prepare("SELECT * FROM `wpr3_posts` WHERE post_content LIKE '%perfil.mercadolivre.com.br/MARCH+GOLD%'");
$SQl_update = DB::getConn()->prepare("UPDATE `wpr3_posts` SET `post_content` = ? WHERE ID = ?");
$SQl_list -> execute();
var_dump( DB::getConn());
while ($res = $SQl_list->fetch(PDO::FETCH_ASSOC)){
$h = str_replace('https://perfil.mercadolivre.com.br/MARCH+GOLD', 'http://perfil.mercadolivre.com.br/MARCH+GOLD', $res['post_content']);
$SQl_update -> execute(array($h,$res['ID']));
}
This code is not mine, the problem is that with this coding the site in general became slow, I would like to know what the problem is and how I can fix it. I was told that the problem is also that it overwritten too many images that were not to be replaced, probably it pulled too many images than it should and now to load the database, it got complicated. Thanks in advance!
How many records in the table?
– Lucas Torres