auto-populating multiple boxes... php and pg_fetch_array problem?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi everybody,
there is a nice tool using jquery/php 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...-php-and-pg_fetch_array-problem--tf4948560.html#a14168475
Sent from the PHP - General mailing list archive at Nabble.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux