hola,
me encuentro con un problema al recoger unas variables de un form. las envio por ajax y las recogo en Php para hacer una consulta:
Código PHP:
$date1 = "'".$_POST['date1']."'"; //le meto echos para ver q los recibe
$date2 = "'".$_POST['date2']."'";
$especies_procesar = $_POST['especies'];
parece q los datos los recibe la primera vez pero despues casca y no hace la consulta claro, una vez ejecutada la consulta en firebug el post me pone:
Código HTML:
'20111002''20111014'#'15'select id_haul, id_catch, shooting_time, total_discarded_weight, a_code, ST_AsGeoJSON(geom, 4) AS geojson from "haul" natural inner join catch where a_code in ('15') and shooting_time between '20111002' and (timestamp '20111014' + interval '1 days')
como veis la primera vez pasa los parametros del form, pero despues...
aqui veo q los datos los pasa, pero el Get:
Código HTML:
Notice: Undefined index: date1 in /var/www/html/faros/Geo/consulta2.php on line 8
''
Notice: Undefined index: date1 in /var/www/html/faros/Geo/consulta2.php on line 11
Notice: Undefined index: date2 in /var/www/html/faros/Geo/consulta2.php on line 13
''
Notice: Undefined index: date2 in /var/www/html/faros/Geo/consulta2.php on line 16
Notice: Undefined index: especies in /var/www/html/faros/Geo/consulta2.php on line 18
Notice: Undefined index: especies in /var/www/html/faros/Geo/consulta2.php on line 21
select id_haul, id_catch, shooting_time, total_discarded_weight, a_code, ST_AsGeoJSON(geom, 4) AS geojson from "haul" natural inner join catch where a_code in () and shooting_time between '' and (timestamp '' + interval '1 days')
Warning: pg_query(): Query failed: ERROR: syntax error at or near ")" at character 161 in /var/www/html/faros/Geo/consulta2.php on line 27
Query failed: ERROR: syntax error at or near ")" at character 161
alguno me puede ayudar. gracias.