Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/11/2004, 11:58
Danylo
 
Fecha de Ingreso: noviembre-2004
Ubicación: Oaxaca, Mexico
Mensajes: 97
Antigüedad: 19 años, 5 meses
Puntos: 0
Problemas con una consulta

Me sale el siguiente error:

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 'cve_area_resp='DK09A' and cve_pob='03' and cve_ruta='147' and h


La sintaxis es la siguiente:

$qry=mysql_query("select * from tomas where num_tarea='".$num_tarea."' and rpe_asig='".$rpe."' and ciclo='".$ciclo."' cve_area_resp='".$cve_area_resp."' and cve_pob='".$cve_pob."' and cve_ruta='".$cve_ruta."' and hora='".$hora."' and fecha='".$fecha."' ",$atcon) or die (mysql_error());

eh pensado que tal vez sea la forma en la que obtengo la fecha y hora pero no estoy seguro:

$h=substr($linea,122,2);
$m=substr($linea,124,2);
$s=substr($linea,125,2);
$hora="$h:$m:$s";
$anio=substr($linea,128,4);
$mes=substr($linea,132,2);
$dia=substr($linea,134,2);
$fecha="$anio-$mes-$dia";

$linea se refiere a una linea de un archivo de texto que analizo antes, pero borro la comparación de fecha y hora y me marca error con $atcon y no puedo distinguir un error en la sintaxis, espero que uno de ustedes que tenga mas experiencia me pueda ayudar.