Re: [PHP-DB] Postgre SQL query error with PHP

2005-07-04 Thread Thomas Bonham
Thanks for the help.
It is working like it should.

Next on the query parameters.

Again Thanks for the help.
Thomas

On 7/2/05, Martín Marqués martin@bugs.unl.edu.ar wrote:
 El Sáb 02 Jul 2005 14:21, John DeSoi escribió:
 
  On Jul 2, 2005, at 9:17 AM, Thomas Bonham wrote:
 
   If you wouldn't mind look over this error to I would be very nice.
   The error that I'm have now is the following. It is probely very
   sample, but I'm still learning php so not for me it not.
 
  There is an example here, that I think will help you.
 
  http://www.php.net/manual/en/function.pg-fetch-row.php
 
  And if that does not help try just printing out the entire array so
  you know what is there.
 
  See the var_dump function:
 
  http://us2.php.net/manual/en/function.var-dump.php
 
 
 I personally think he should start here:
 
 http://pear.php.net/manual/en/package.database.db.php
 
 
 --
 select 'mmarques' || '@' || 'unl.edu.ar' AS email;
 -
 Martín Marqués  |   Programador, DBA
 Centro de Telemática| Administrador
Universidad Nacional
 del Litoral
 -
 


-- 
--
Thomas Bonham
[EMAIL PROTECTED]
bonhamlinux.org
Cell 602-402-9786

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



Re: [PHP-DB] Postgre SQL query error with PHP

2005-07-02 Thread John DeSoi


On Jul 1, 2005, at 9:37 PM, Thomas Bonham wrote:


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



The first error is telling you that you don't have permission to  
select from the property table. See the GRANT command and make sure  
you have the correct permissions to work with the table.


The warning needs to be fixed also. The pg_num_rows command only  
takes one parameter. You need to remove the $dbconn parameter.



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

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



Re: [PHP-DB] Postgre SQL query error with PHP

2005-07-02 Thread Thomas Bonham
Thank.
The grant work.

If you wouldn't mind look over this error to I would be very nice.
The error that I'm have now is the following. It is probely very
sample, but I'm still learning php so not for me it not.

Error:
Connection to Data Base established
Notice: Uninitialized string offset: 1 in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 27

Notice: Uninitialized string offset: 2 in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 28

Notice: Uninitialized string offset: 3 in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 29

Notice: Uninitialized string offset: 4 in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 30

Notice: Uninitialized string offset: 5 in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 31

Notice: Uninitialized string offset: 6 in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 32

Notice: Uninitialized string offset: 7 in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 33

Notice: Uninitialized string offset: 8 in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 34

Notice: Uninitialized string offset: 9 in
/var/www/html/thomas/cis166ae/database/web_users/dan/newrow.php on
line 35
data: 1, , , , , , , , , , 

It prints the first one then it errors.

Thank agin
Thomas

On 7/2/05, John DeSoi [EMAIL PROTECTED] wrote:
 
 On Jul 1, 2005, at 9:37 PM, Thomas Bonham wrote:
 
  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
  );
 
 
 The first error is telling you that you don't have permission to
 select from the property table. See the GRANT command and make sure
 you have the correct permissions to work with the table.
 
 The warning needs to be fixed also. The pg_num_rows command only
 takes one parameter. You need to remove the $dbconn parameter.
 
 
 John DeSoi, Ph.D.
 http://pgedit.com/
 Power Tools for PostgreSQL
 
 


-- 
--
Thomas Bonham
[EMAIL PROTECTED]
bonhamlinux.org
Cell 602-402-9786

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



Re: [PHP-DB] Postgre SQL query error with PHP

2005-07-02 Thread John DeSoi


On Jul 2, 2005, at 9:17 AM, Thomas Bonham wrote:


If you wouldn't mind look over this error to I would be very nice.
The error that I'm have now is the following. It is probely very
sample, but I'm still learning php so not for me it not.


There is an example here, that I think will help you.

http://www.php.net/manual/en/function.pg-fetch-row.php

And if that does not help try just printing out the entire array so  
you know what is there.


See the var_dump function:

http://us2.php.net/manual/en/function.var-dump.php




John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

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



Re: [PHP-DB] Postgre SQL query error with PHP

2005-07-02 Thread Martín Marqués
El Sáb 02 Jul 2005 14:21, John DeSoi escribió:
 
 On Jul 2, 2005, at 9:17 AM, Thomas Bonham wrote:
 
  If you wouldn't mind look over this error to I would be very nice.
  The error that I'm have now is the following. It is probely very
  sample, but I'm still learning php so not for me it not.
 
 There is an example here, that I think will help you.
 
 http://www.php.net/manual/en/function.pg-fetch-row.php
 
 And if that does not help try just printing out the entire array so  
 you know what is there.
 
 See the var_dump function:
 
 http://us2.php.net/manual/en/function.var-dump.php


I personally think he should start here:

http://pear.php.net/manual/en/package.database.db.php


-- 
select 'mmarques' || '@' || 'unl.edu.ar' AS email;
-
Martín Marqués  |   Programador, DBA
Centro de Telemática| Administrador
   Universidad Nacional
del Litoral
-

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



[PHP-DB] Postgre SQL query error with PHP

2005-07-01 Thread Thomas Bonham
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
[EMAIL PROTECTED]
bonhamlinux.org
Cell 602-402-9786

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



[PHP-DB] Postgre

2003-03-07 Thread Marcos
Hey...

Im having trouble on installing Postgre modules over PHP 4.3. I just dunno how to 
install it and didnt find any doc. May anyone help me ?

Thanks,

Marcos
Brazil - SC - Blumenau