Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/01/2010, 08:55
ron234
 
Fecha de Ingreso: noviembre-2008
Mensajes: 48
Antigüedad: 15 años, 5 meses
Puntos: 0
traspaso de datos

tengo una 2 tablas una se llama fototemp y la otra se llama pacientes en la tabla fotostemp tengo los campos fotos en longblob thumb en longblob y mime en varchar(40) en pacientes tengos otros campos mas los tres de fotostemp el problema q tengo yo cargo la tabla fotostemp con unas fotos y me la carga bien pero a la hora que quiero pasar esos datos a la tabla real q es pacientes me genera un error es asi: "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 '()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰ Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄ' at line 1" y el codigo q utilizo es el siguiente:

$fd="SELECT codpaciente FROM pacientes ORDER BY codpaciente DESC LIMIT 1";
$cg=mysql_query($fd);
$rf=mysql_num_rows($cg);
if ($rf>0)
{
$ds=mysql_fetch_array($cg);
$cq="SELECT * FROM fotostemp";
$yu=mysql_query($cq);
$jh=mysql_num_rows($yu);
if ($jh>0)
{
$hy=mysql_fetch_array($yu);
$ghj="UPDATE pacientes SET foto='$hy[foto]', thumb='$hy[thumb]', mime='$hy[mime]' WHERE codpaciente='".$ds[codpaciente]."'";
$qwe=mysql_query($ghj) or die(mysql_error());
}
}
le agradezco su ayuda