Re: [PHP-DB] Re: PostgreSQL error with PHP

2005-06-27 Thread Martín Marqués
El Dom 26 Jun 2005 22:48, Thomas Bonham escribió:
 Thanks for the help.
 The code now looks like this.
 CODE:
 
 htmlheadtitleLogin/title
 
 /head
 body
 ?php
   
   $conn = pg_connect(user=auth dbname=auth password=redhat)
   or die (Could not connect) ;
   echo Connectd Successfully;
   pg_close($conn);
   
 ?
 /body
 /html
 
 And now the error I get is the following.
 
 
 Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: 
 IDENT authentication failed for user auth in 
 /var/www/html/thomas/cis166ae/database/secretdb.php on line 8
 Could not connect

Check your pg_hba.conf file. Looks like you have IDENT authentification, and 
auth is not a system user.

Read the PostgreSQL documentation about this.

-- 
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] problem getting started...

2005-06-27 Thread D . C .

Hi, I'm having problems getting started with PhP..

I have a postgreSQL installation on my iBook (Mac-OSX 10.3.9), which 
runs perfectly as I've been using it for months.


I checked phpinfo() and it showed version 4.3.11, so I got the source 
for 5.0.4 and installed it.  However, phpinfo() still says 4.3.11. I 
stopped and started apache .. anything else I need to do ?


Also, if I try the source from this tutorial 
http://www.phpfreaks.com/tutorials/60/1.php, I get ..


'Fatal error: Call to undefined function: pg_connect() in 
/Library/WebServer/Documents/toto.php on line 10'


Yet if I look in phpinfo() again, I see ..

'supported databases
MySQL ODBC PostgreSQL Microsoft SQL Server FrontBase Oracle 8 (oci8) 
Sybase-CT'


I'm trying to do a database back-end for a friend's e-commerce site .. 
but if I can't even use the simplest php commands.. :-(


Thanks.

D.






___ 
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
Téléchargez cette version sur http://fr.messenger.yahoo.com



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



[PHP-DB] PostgreSQL 7.2 - 8.0 replication issue

2005-06-27 Thread Mark Galbreath
I have to upgrade a web app from PHP 4.3.11 with PostgreSQL 7.2 to PHP 5.0.4 
with PostgreSQL 8.0.3.

Currently I have PHP4 (as Apache 2.54 mod on port 80) and PHP5 (default CGI 
mode on port 8181) running concurrently on my DEV box.  I installed PostgreSQL 
8.0.3 on the DEV box as well.

On the PostgreSQL 7.2 server, I did a pg_dumpall  db.out and ftp'd db.out to 
the PostgreSQL 8.0.3 (DEV) server.  When I attempt to pg_restore db.out, the 
PostgreSQL archiver aborts with the error: input file does not appear to be a 
valid archive

I'd sure appreciate a clue on this issue!

tia,
~mark





***
This email and any file transmitted with it may be confidential and is intended 
solely for the use of the individual or entity to whom it is addressed.  If you 
received this email in error please notify the DBM Service Desk by forwarding 
this message to [EMAIL PROTECTED]


This email has been scanned by networkMaryland Antivirus Service for the 
presence of computer viruses.

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



Re: [PHP-DB] PostgreSQL 7.2 - 8.0 replication issue

2005-06-27 Thread D . C .

Le 27 juin 05, à 20:31, Mark Galbreath a écrit :

I have to upgrade a web app from PHP 4.3.11 with PostgreSQL 7.2 to PHP 
5.0.4 with PostgreSQL 8.0.3.


Currently I have PHP4 (as Apache 2.54 mod on port 80) and PHP5 
(default CGI mode on port 8181) running concurrently on my DEV box.  I 
installed PostgreSQL 8.0.3 on the DEV box as well.


On the PostgreSQL 7.2 server, I did a pg_dumpall  db.out and ftp'd 
db.out to the PostgreSQL 8.0.3 (DEV) server.  When I attempt to 
pg_restore db.out, the PostgreSQL archiver aborts with the error: 
input file does not appear to be a valid archive


I'd sure appreciate a clue on this issue!


Try -format .. and output it as ASCII ... I _seem_ to recall having a 
similar issue a month or so ago .. this is really a PostgreSQL issue, 
though.


D.`

--  
Des Coughlan

[EMAIL PROTECTED]






___
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez cette version sur http://fr.messenger.yahoo.com


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



RE: [PHP-DB] PostgreSQL 7.2 - 8.0 replication issue

2005-06-27 Thread Mark Galbreath
Thanks for your reply, Des; unfortunately, your suggestion had no affect.  I 
realize this is technically a PostgreSQL issue, but rationalized my request 
help here because (1) this is the PHP-DB list and PHP is used with MySQL and 
PostgreSQL more than any other databases, and (2) I assumed that since PHP5 and 
PostgreSQL 8.0 have been released, there are many developers who have had to 
deal with this or a similar problem.

~mark

-Original Message-
From: D.C. [mailto:[EMAIL PROTECTED]
Sent: Monday, June 27, 2005 2:43 PM

Le 27 juin 05, à 20:31, Mark Galbreath a écrit :

 I have to upgrade a web app from PHP 4.3.11 with PostgreSQL 7.2 to PHP 
 5.0.4 with PostgreSQL 8.0.3.

 Currently I have PHP4 (as Apache 2.54 mod on port 80) and PHP5 
 (default CGI mode on port 8181) running concurrently on my DEV box.  I 
 installed PostgreSQL 8.0.3 on the DEV box as well.

 On the PostgreSQL 7.2 server, I did a pg_dumpall  db.out and ftp'd 
 db.out to the PostgreSQL 8.0.3 (DEV) server.  When I attempt to 
 pg_restore db.out, the PostgreSQL archiver aborts with the error: 
 input file does not appear to be a valid archive

 I'd sure appreciate a clue on this issue!

Try -format .. and output it as ASCII ... I _seem_ to recall having a 
similar issue a month or so ago .. this is really a PostgreSQL issue, 
though.






This email and any file transmitted with it may be confidential and is intended 
solely for the use of the individual or entity to whom it is addressed.  If you 
received this email in error please notify the DBM Service Desk by forwarding 
this message to [EMAIL PROTECTED]


This email has been scanned by networkMaryland Antivirus Service for the 
presence of computer viruses.

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



Re: [PHP-DB] PostgreSQL 7.2 - 8.0 replication issue

2005-06-27 Thread D . C .

Le 27 juin 05, à 21:23, Mark Galbreath a écrit :

Thanks for your reply, Des; unfortunately, your suggestion had no 
affect.  I realize this is technically a PostgreSQL issue, but 
rationalized my request help here because (1) this is the PHP-DB list 
and PHP is used with MySQL and PostgreSQL more than any other 
databases, and (2) I assumed that since PHP5 and PostgreSQL 8.0 have 
been released, there are many developers who have had to deal with 
this or a similar problem.


Hey, no worries.  I wasn't actually 'flaming' you for posting your 
question here, as I've been subscribed all of two hours myself .. .but 
I did have exactly the same problem with pg_dump as you.  Google for my 
name and pg_dump, and it might turn up.  Regards ...


D.

--  
Des Coughlan

[EMAIL PROTECTED]






___
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez cette version sur http://fr.messenger.yahoo.com


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



RE: [PHP-DB] PostgreSQL 7.2 - 8.0 replication issue

2005-06-27 Thread Mark Galbreath
The solution was to make sure that ftp mode is in ASCII (type I) and then 
execute the following, assuming a dummy database, test, has been created as 
part of the installation, and the database dump resides at 
/usr/local/pgsql/temp:

On 7.2 server:
$ /usr/local/pgsql/bin/pg_dumpall --format=ASCII  db.out

On 8.0.3 server:

$ ftp [IP address]
$ ftpcd [db.out location]
$ ftplcd /usr/local/pgsql/temp
$ ftpascii
$ ftpget db.out
$ ftpbye

$ /usr/local/pgsql/bin/psql test

# \i /usr/local/pgsql/temp/db.out
[database]-# \q
$

-
That's it.  This was by no means obvious from the documentation, by the way.

But now the real fun begins...will the migration work?  Stay tuned

~mark

-Original Message-
From: D.C. [mailto:[EMAIL PROTECTED]
Sent: Monday, June 27, 2005 4:23 PM

Le 27 juin 05, à 21:23, Mark Galbreath a écrit :

 Thanks for your reply, Des; unfortunately, your suggestion had no 
 affect.  I realize this is technically a PostgreSQL issue, but 
 rationalized my request help here because (1) this is the PHP-DB list 
 and PHP is used with MySQL and PostgreSQL more than any other 
 databases, and (2) I assumed that since PHP5 and PostgreSQL 8.0 have 
 been released, there are many developers who have had to deal with 
 this or a similar problem.

Hey, no worries.  I wasn't actually 'flaming' you for posting your 
question here, as I've been subscribed all of two hours myself .. .but 
I did have exactly the same problem with pg_dump as you.  Google for my 
name and pg_dump, and it might turn up.  Regards ...

D.

--  
Des Coughlan
[EMAIL PROTECTED]





***
This email and any file transmitted with it may be confidential and is intended 
solely for the use of the individual or entity to whom it is addressed.  If you 
received this email in error please notify the DBM Service Desk by forwarding 
this message to [EMAIL PROTECTED]


This email has been scanned by networkMaryland Antivirus Service for the 
presence of computer viruses.

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



Re: [PHP-DB] PostgreSQL 7.2 - 8.0 replication issue

2005-06-27 Thread Martín Marqués
El Lun 27 Jun 2005 17:48, Mark Galbreath escribió:
 The solution was to make sure that ftp mode is in ASCII (type I) and then 
execute the following, assuming a dummy database, test, has been created as 
part of the installation, and the database dump resides 
at /usr/local/pgsql/temp:

The best thing, giving the case that he's using Linux, is to use scp.

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



Re: [PHP-DB] PostgreSQL 7.2 - 8.0 replication issue

2005-06-27 Thread Martín Marqués
El Lun 27 Jun 2005 15:31, Mark Galbreath escribió:
 I have to upgrade a web app from PHP 4.3.11 with PostgreSQL 7.2 to PHP 5.0.4 
with PostgreSQL 8.0.3.
 
 Currently I have PHP4 (as Apache 2.54 mod on port 80) and PHP5 (default CGI 
mode on port 8181) running concurrently on my DEV box.  I installed 
PostgreSQL 8.0.3 on the DEV box as well.
 
 On the PostgreSQL 7.2 server, I did a pg_dumpall  db.out and ftp'd db.out 
to the PostgreSQL 8.0.3 (DEV) server.  When I attempt to pg_restore db.out, 
the PostgreSQL archiver aborts with the error: input file does not appear to 
be a valid archive

Never used pg_restore. I just do this:

$ psql -f db.out

Always worked for me.

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



Re: [PHP-DB] PostgreSQL 7.2 - 8.0 replication issue

2005-06-27 Thread Luis Morales
Hi,

I write an litle procedure about migration from postgres 7x to 8x. 

this is the link:
http://fastonion.blogspot.com/2005/04/gentoo-migrando-postgres-7x-8.html

In Resume you must be do:

On current DB Server:
su - postgres
pg_dumpall  /tmp/db.out


On remote DB Server:
copy db.out to new location on new server
su - postgres 
psql -f db.out template1

Good Luck! 

Regards,

Luis Morales

On Mon, 2005-06-27 at 15:46 -0300, Martín Marqués wrote:
 El Lun 27 Jun 2005 15:31, Mark Galbreath escribió:
  I have to upgrade a web app from PHP 4.3.11 with PostgreSQL 7.2 to PHP 
  5.0.4 
 with PostgreSQL 8.0.3.
  
  Currently I have PHP4 (as Apache 2.54 mod on port 80) and PHP5 (default CGI 
 mode on port 8181) running concurrently on my DEV box.  I installed 
 PostgreSQL 8.0.3 on the DEV box as well.
  
  On the PostgreSQL 7.2 server, I did a pg_dumpall  db.out and ftp'd db.out 
 to the PostgreSQL 8.0.3 (DEV) server.  When I attempt to pg_restore db.out, 
 the PostgreSQL archiver aborts with the error: input file does not appear to 
 be a valid archive
 
 Never used pg_restore. I just do this:
 
 $ psql -f db.out
 
 Always worked for me.
 
 -- 
 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] Batch queries in the same mysql_query()

2005-06-27 Thread Denio Mariz

Hi,

I'm trying to execute multiple queries using mysql_query() function and I'm 
getting an error to check SQL syntax.

My PHP code looks like:

//-
$sql=select x from y ; insert into y values ( 1, 2 );
mysql_query( $sql ) or die( mysql_error() );
//-

Maybe the problem resides on the character ;, but this queries run 
without problems when typed on mysql command-line tool. So, if it works 
on mysql command line, why it doesn't work using mysql_query() ?


Any hint ?

TIA,

Denio Mariz

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