[jQuery] auto-populating multiple boxes... problem with pg_fetch_array?
hi everybody,
there is a nice tool to populate multiple select boxes out there :
http://remysharp.com/2007/09/18/auto-populate-multiple-select-boxes/
it must be a very stupid question but I’m trying to apply this tool to get
data from postgreSQL, but I always get an empty [] value. It means that the
array $json[] is not filled in the while statement. But the dbase connection
and the query is correct ( I can check applying a echo “data: “.$row[0].”";
and all the data is displayed).
I suppose pg_fetch_array is not used correctly (I have checked also
pg_fetch_object)...but I'm not sure because I'n newbie to jquery and json.
If someone has success connecting to postgresql...
Thanks!
After inserting data....
$postgis_result=pg_query("select * from select_chain where
genus='".strtolower(pg_escape_string(strip_tags($_REQUEST['category'])))."'");
$json = array();
while (is_resource($postgis_result) && $row =
pg_fetch_array($postgis_result)) {
$json[] = '"' . $row->label . '"';
}
echo '[' . implode(',', $json) . ']';
die();
--
View this message in context: http://www.nabble.com/auto-populating-multiple-boxes...-problem-with-pg_fetch_array--tf4948558s27240.html#a14168473
Sent from the jQuery General Discussion mailing list archive at Nabble.com.