Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.11.5

Bug #532 insert() with key=0
Submitted: 2004-01-07 11:27 UTC
From: garbage at openfutura dot com Assigned: alan_k
Status: Closed Package: DB_DataObject
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 45 - 25 = ?

 
 [2004-01-07 11:27 UTC] garbage at openfutura dot com
Description: ------------ To create a new record (MySQL) in which i'll put new data, i used to try the following syntax: $item = new DBO_MyDBObject(); $item->id = 0; //id is the key with auto_increment flag on $newid = $item->insert(); I have my own class which encapsulates DB_DataObject, and there's a class function (method nuevo()) in which i put the above code (more or less) returning the newly created primary key. I then redefine the methods when needed. But since i do not know the definition of the objects which will inherit this nuevo() method (id is standard and every table i create has its primary key named like that), i cannot state a field to be filled with initial data to insert. I just need EMPTY data, with an auto_incremented key written to this new record. This method used to work fine until DB_DataObject 1.3 i guess. Now it is broken. Is there any way you can fix this annoying behaviour?

Comments

 [2004-01-09 06:47 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-01-09 19:02 UTC] garbage at openfutura dot com
Nope. No fix using CVS. But release 1.3 works fine.
 [2004-01-10 01:18 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-01-10 02:02 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-01-10 04:52 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-01-10 10:40 UTC] garbage at openfutura dot com
Certainly fixed. Just wanted to thank you for your work & time.