Ver Mensaje Individual
  #4 (permalink)  
Antiguo 10/04/2010, 11:38
Avatar de mayid
mayid
Colaborador
 
Fecha de Ingreso: marzo-2009
Ubicación: BsAs
Mensajes: 4.014
Antigüedad: 15 años, 1 mes
Puntos: 101
Respuesta: reemplazar algo en todas las tablas (y campos) de mysql

Gracias. Si, conozco el nombre de las tablas. Tengo entonces un array, y ejecuto esto, pero no reemplaza nada!:

Cita:
foreach($tablas as $tabla){

$q = mysql_query("SELECT id, sections FROM $tabla");

while($section = mysql_fetch_array($q)){

$brs=preg_replace("/<br>/is","<br />",$section['sections']);
$query = mysql_query("UPDATE $tabla SET sections = $brs WHERE id = ".$section['id']);
}

}
Error:
Cita:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '