Me da los siguiente errores:
arning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in usr/home/bvNx1R8Zzc98/xxxx.php on line 68
The system reported the next message:
Invalid query: 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
Warning: preg_replace() [function.preg-replace]: Compilation failed: missing terminating ] for character class at offset 3 in /usr/home/bvNx1R8Zzc98/xxxx.php on line 299
Warning: preg_replace() [function.preg-replace]: Compilation failed: missing terminating ] for character class at offset 3 in usr/home/bvNx1R8Zzc98/xxxx.php on line 300
Warning: fsockopen() [function.fsockopen]: unable to connect to mail.xxx.es:25 (Connection timed out) in usr/home/bvNx1R8Zzc98/xxxx.php on line 88
Código PHP:
/ Obtenemos el mail del cliente
//----------------------------------------
$consulta="SELECT * FROM clientes WHERE id=".$id_cliente.";";
$result = mysql_query($consulta, $link);
$row = mysql_fetch_array($result); /// ERROR linea 68
$email_cliente=$row['email'];
$pattern = "#[\]#";
$body = preg_replace($pattern,'',$body); ///ERROR linea 299
$subject = preg_replace($pattern,'',$subject); ///ERROR LINEA 300
$mail2->From = $email_tienda ;
$mail2->FromName = $email_tienda_nombre;
$mail2->Subject = "Se ha detectado un error en el proceso de un pedido.";
$mail2->AltBody = "Por favor, use un lector de correo compatible con HTML."; // optional, comment out and test
$mail2->MsgHTML($body);
$mail2->AddAddress($email_tienda, "Formularios");
//echo $body;
// Obtenemos el importe minimo de la oferta
//-------------------------------------------
$fecha_hoy=date("Y-m-j");
$consulta=" SELECT * FROM ofertas
WHERE fecha_inicio <='".$fecha_hoy."'
AND fecha_fin>='".$fecha_hoy."' ;";
$result = mysql_query($consulta, $link); //ERROR LINEA 88
$row = mysql_fetch_array($result);
$importe_para_oferta=$row['importe_para_oferta'];
$oferta=$row['oferta'];
Un saludo y muchas gracias!!