<?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 was slow, I would like to know what the problem is and how can I fix it. I was told that the problem is also that it replaced more images that were not to be replaced, probably it pulled more images than it should and now to load the database, it was complicated. Thank you in advance!