postgresql database access failure

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

 



Readers,

A postgresql database (local disk installation) is successfully
accessed as a normal user:

psql -U username databasename

However, creating a php file to access the database has not been successful.

<html>
<body>
	<?php
		$db = pg_connect('dbname=databasename user=username');
		$query = 'SELECT * FROM databasename';
		$value=pg_fetch_result($query,1,0);
		echo 'export of database is ',$value,'';
	?>
	<p>
		why does this fail?
	</p>
	</body>
</html>

The following php code produces the user agent:

	<?php
		echo '$_SERVER['HTTP_USER_AGENT']';
	?>

-- 
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