Re: pg_Exec: Warning: 1 is not a valid PostgreSQL link resource.

From: Date: Sun, 04 Feb 2001 03:36:33 +0000
Subject: Re: pg_Exec: Warning: 1 is not a valid PostgreSQL link resource.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-38064@lists.php.net to get a copy of this message
> We have a host (host A) with PostgreSQL 7.0.3. and PHP 4.0.4 under Red Hat > > We have another host (host B) with PHP 4.0.3pl1 under Debian > > We are having an incomprehensible error with this code when the content of $sql is > > and "update" > > ... > > $resultado=pg_Exec($conexion,$sql); > > ... > > 1) The php code from host A works ok. > > 2) The same php code from host B accessing postgresql database on host A > > does not work with "update", but it works with "select", > "insert", and "delete". > > 3) If I try from host B: psql -h hostA -d database -u > > update fam set nom='xxxxxx' where id='23' > > it works ok. > > 4) So, where is the problem? php4 libraries under Debian distribution? Any chance the user permissions are disallowing an update from host B?... Or are you actually using the same username/password when you do it in the psql monitor? [I tend to use my 'real' Postgres account in the monitor and the 'restricted' one in my PHP pages... But maybe that's just my own folly. :-) ] pg_exec() usually sends an error when something goes wrong... Is your error_reporting() set to 15? Better yet, use pg_errormessage() to see if maybe you can dig something out of that. If all that fails, I'd suggest searching http://bugs.php.net and posting there if it's not a known bug. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm

« previous php.general (#38064) next »