note 7749 added to pg_exec
| From: | jeff at pgsql dot com | Date: | Mon, 14 Aug 2000 02:11:47 +0000 |
| Subject: | note 7749 added to pg_exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-1811@lists.php.net to get a copy of this message | ||
few note/tips for everyone out there
1: that getlast oid or whatever it's called. that's slow and painful.. try this.
if your table (ie "users" has a serial type (ie "uid") and you want to find out
the most recent one. do this select
SELECT currval('id_users_seq');
2nd tip to see if a INSERT/UPDATE worked
or not and how to suppress it's error message
1: $insert=@pg_exec($dbh,$insertstring)
if ($insert == 0 ) { /* it screwed up */ }
2: the @ infron of pg_exec suppresses the errors.
jeff@pgsql.com
http://www.php.net/manual/function.pg-exec.php