Hello All,
I'm having a problem setting up the query with postgreSQL. I can do
what I won't for the command line but it error when I try it with the
PHP functions.
My errors and code are below.
/* Setting up connection to data base. */
$conn = "dbname='cornerstone_property' user='stone' host='localhost'";
/* Connecting to the data base */
$dbconn = pg_connect("dbname='cornerstone_property' user='stone'
/* Connecting to see if the connection is true */
if($dbconn == true)
echo "Connection to Data Base established";
echo "Connection to Data Base failed";
/* End of Connectting to the data base */

$query = pg_query ("
SELECT * FROM property
$rows = pg_num_rows($dbconn,$query);

for ($i = 0; $i < $rows; $i++)
$data = pg_fetch_result($query, $i);
echo "data: $data[0],
Connection to Data Base established
Warning: pg_query(): Query failed: ERROR: permission denied for
relation property in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 20

Warning: Wrong parameter count for pg_num_rows() in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 21

As it show above I can connect to the database but no query.
The part of the code that is error "I Think" is the following.
$query = pg_query ("
SELECT * FROM property
Thanks for the help.

Thomas Bonham
Cell 602-402-9786

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

Reply via email to