Home » Database » DB_DataObject » Bug #3320
insert() does not return the ID of the inserted element
Details
| Submitted | 2005-01-28 13:45 UTC |
|---|---|
| From | mishal at centrum dot cz |
| Status | Bogus |
| Package | DB_DataObject |
| PHP Version | 4.3.6 |
| OS | Win XP |
| Roadmaps | (Not assigned) |
Comments
[2005-01-28 13:45 UTC] mishal at centrum dot cz
Description:
------------
The DataObject docs say that DB_DataObject insert() method returns the ID of the inserted element, but in reality it does NOT. I found that insert() using DB_DataObject version 1.4 does work as expected.(ID of the inserted element IS returned)
My key is set as primary key, auto increment, int(11)
here is the section from my database.ini file:
[mailinglist_subscribers]
subscriber_id = 129
name = 2
email = 130
[mailinglist_subscribers__keys]
subscriber_id = N
I use:
DB_DataObject version 1.7.2
mySQL 4.0.2
Expected result:
----------------
insert() returns the ID of the inserted element
Actual result:
--------------
TRUE if successfully inserted or false if NOT
[2005-01-28 14:49 UTC] mishal at centrum dot cz
I tried the cvs version of dataobjects (mysqli extension requires php5; i don't have php5 installed :-( )
I still get true, no ID.
[2005-02-01 07:29 UTC] mishal at centrum dot cz
I get this result:
dao_mailinglist_subscribers: databaseStructure: Loaded ini file: E:\localhost\cache/entities/database.ini
dao_mailinglist_subscribers: databaseStructure: Loaded links.ini file: E:\localhost\cache/entities/database.links.ini
dao_mailinglist_subscribers: QUERY: INSERT INTO `mailinglist_subscribers` (`name` , `email` ) VALUES ('foo26181' , '16794@foo.com2763' )
dao_mailinglist_subscribers: query: QUERY DONE IN 0,0480620861053 seconds
-----
the result returned by insert() is true
[2005-02-01 07:48 UTC] mishal at centrum dot cz
When playing around with db_dataobject I found that i have this :'ignore_sequence_keys' => 'ALL', in my db_dataobject options. when disabling it, it works.
My appologies for being so dumb.
Please mark this bug report as irrelevant.
Sorry.