Postgre SQL query error with PHP

From: Date: Sat, 02 Jul 2005 01:37:50 +0000
Subject: Postgre SQL query error with PHP
Groups: php.db 
Request: Send a blank email to php-db+get-39837@lists.php.net to get a copy of this message
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. CODE: <?php /* 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' host='localhost'"); /* Connecting to see if the connection is true */ if($dbconn == true) { echo "Connection to Data Base established"; } else { 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], $data[1], $data[2], $data[3], $data[4], $data[5], $data[6], $data[7], $data[8], $data[9], <br>\n"; } pg_close($dbconn); ?> Error: 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 -- ------------------------------------------------------------------ Thomas Bonham thomasbbonham@gmail.com bonhamlinux.org Cell 602-402-9786

« previous php.db (#39837) next »