Re: DB_Dataobject insert() returning null

From: Date: Mon, 28 Feb 2005 01:03:15 +0000
Subject: Re: DB_Dataobject insert() returning null
References: 1  Groups: php.pear.general php.pear.general 
Request: Send a blank email to pear-general+get-17716@lists.php.net to get a copy of this message
It should work, however check with http://pear.php.net/manual/en/package.database.db-dataobject.db-dataobject.insert.php to see why it may not work.. (otherwise try the CVS version, or you may have to go on a bug hunting trip..) Regards Alan On Fri, 2005-02-25 at 17:48 +0000, Peter Bowyer wrote: > Hi, > > I have a DataObject for the table shown below. My ini file lists a key > column, so I believe this should work. Yet the value of $record_id is NULL. > > > CREATE TABLE subscriber ( > user_id int(10) unsigned NOT NULL auto_increment, > username varchar(45) NOT NULL default '', > password varchar(32) NOT NULL default '', > firstname varchar(45) NOT NULL default '', > lastname varchar(45) NOT NULL default '', > ... > PRIMARY KEY (user_id) > ) TYPE=MyISAM; > > And the code: > $s =& DB_DataObject::factory('Subscriber'); > $s->setRowValues($_POST); > $s->role = 1; // Basic user > $record_id = $s->insert(); > > Any ideas why? > > Thanks, > Peter >

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