Ver Mensaje Individual
  #4 (permalink)  
Antiguo 09/04/2014, 13:40
telkrom
 
Fecha de Ingreso: mayo-2011
Mensajes: 17
Antigüedad: 13 años, 9 meses
Puntos: 4
Respuesta: Recoger valores de un checkbox sacado de mysql en array

"Solucionado", tenía la inserción fuera del foreach...:S

Así si:

foreach ($selecciones as &$tipoLugar)
{
printf("$tipoLugar");
$insertar = "INSERT INTO lugar_tiposlugar (codLugar, codTipoLugar) VALUES('$codLugar','$tipoLugar')";
$insercion = mysql_query($insertar);
}

Aunque a pesar de hacer la inserción bien, me devuelve el siguiente mensaje de 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 '1' at line 1