Ver Mensaje Individual
  #6 (permalink)  
Antiguo 26/06/2009, 09:54
Gaug
 
Fecha de Ingreso: junio-2009
Mensajes: 250
Antigüedad: 14 años, 10 meses
Puntos: 1
Respuesta: Problema de sintaxis con 'SELECT'.

Me surgió otro problema, tengo un while así:

Código PHP:
$data2=0;
while ((
$data fgetcsv($handle4096',')) !== FALSE) {
$data str_replace("'","''",$data);
if(
$data!=$data2){

$sintaxis=$data[0]."%";


  
$query_Recordset "SELECT * from otratabla WHERE llave like '".$sintaxis."' order by llave ASC limit 0,1";
$Recordset mysql_query($query_Recordset$conex) or die(mysql_error());
$row_Recordset mysql_fetch_assoc($Recordset);
$clave=$row_Recordset['llave'];
$data2=$data[0];
}

$import="INSERT into tabla(clave,campo2,campo3,campo4) values('$clave','$data[1]','$data[2]','$data[3]')";
$clave++;
$runq mysql_query($import) or die(mysql_error());
echo 
$import;
echo 
"<br>";

Y me marca éste error:
Código PHP:
NoticeUndefined offset1 in C:wampwwwsitiopruebacsv2.php on line 42

Notice
Undefined offset2 in C:wampwwwsitiopruebacsv2.php on line 42

Notice
Undefined offset3 in C:wampwwwsitiopruebacsv2.php on line 42

Notice
Undefined offset4 in C:wampwwwsitiopruebacsv2.php on line 42

Notice
Undefined offset5 in C:wampwwwsitiopruebacsv2.php on line 42

Notice
Undefined offset6 in C:wampwwwsitiopruebacsv2.php on line 42

Notice
Undefined offset7 in C:wampwwwsitiopruebacsv2.php on line 42

Notice
Undefined offset8 in C:wampwwwsitiopruebacsv2.php on line 42

Notice
Undefined offset9 in C:wampwwwsitiopruebacsv2.php on line 42

Notice
Undefined offset10 in C:wampwwwsitiopruebacsv2.php on line 42

Notice
Undefined offset11 in C:wampwwwsitiopruebacsv2.php on line 42

Notice
Undefined offset12 in C:wampwwwsitiopruebacsv2.php on line 42

Notice
Undefined offset13 in C:wampwwwsitiopruebacsv2.php on line 42 
La línea 42 es ésta:

Código PHP:
$import="INSERT into tabla(clave,campo2,campo3,campo4) values('$clave','$data[1]','$data[2]','$data[3]')"
Sin mencionar que pasa varias veces por el 'if', cuando sólo debería pasar la primera vez, o en caso de que cambie el valor de '$clave'
¿Qué es lo causa o cómo puedo resolverlo?

Gracias de antemano, saludos.