Re: DB_Dataobject insert() returning null

From: Date: Sat, 26 Feb 2005 09:12:32 +0000
Subject: Re: DB_Dataobject insert() returning null
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-17695@lists.php.net to get a copy of this message
At 01:17 26/02/2005, Justin Patrin wrote:
insert() *does not* return the key. The key is set in the DO. So $record_id = $s->user_id should get you what you want.
Perhaps you will update the manual then to save other people this frustration. I quote from http://pear.php.net/manual/en/package.database.db-dataobject.db-dataobject.insert.php: "Insert the data into the database, based on the variable values of the current object and returns the ID of the inserted element if sequences or primary keys are being used. The values are correctly quoted, and some limited type checking is done." Kind regards, Peter -- Maple Design - quality web design and programming http://www.mapledesign.co.uk

« previous php.pear.general (#17695) next »