I’m using this script (update https://gist.github.com/3763701) and it works nicely (congrats to the author), but the ‘parameters’ option doesn’t work with my tables, for instance this call:
http://localhost/postgis_geojson.php?geotable=seafloor_thermometry_point_wgs84&geomfield=geom¶meters=source='GEOMAR'
gives:
There was an error parsing the JSON document. The document may not be well-formed.
Document contents:
<br /> <b>Warning</b>: pg_query() [<a href='function.pg-query'>function.pg-query</a>]: Query failed: ERROR: syntax error at or near "GEOMAR" at character 110 in <b>/var/www/html/postgis_geojson.php</b> on line <b>85</b><br /> An SQL error occured.
however, in postgis this call:
select id,fid,source from seafloor_thermometry_point_wgs84 where source='GEOMAR';
gives:
id | fid | source
----+-----+--------
1 | 1 | GEOMAR
2 | 2 | GEOMAR
3 | 3 | GEOMAR
4 | 4 | GEOMAR
...etc
where could the problem be?
thanks for any hint about this,
Gery
EDIT:
my postgis table has PK in id, I’m using postgis 1.5, postgresql 8.4.8, php-5.1.6-27.el5, php-pgsql-5.1.6-27.el5, apache 2 (httpd-2.2.3-43.el5) and Firefox 6.0.2 in rhel5 32-bits,
solution:
On line 70, try changing pg_escape_string($parameters) to just $parameters