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

Request #5345 MDB2_AUTOQUERY_DELETE
Submitted: 2005-09-09 02:25 UTC
From: jausions Assigned: lsmith
Status: Closed Package: MDB2
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 : 30 - 30 = ?

 
 [2005-09-09 02:25 UTC] jausions
Description: ------------ Hi Lukas, great work on the package! Anyway, I was wondering why there wasn't any MDB2_AUTOQUERY_DELETE for the autoPrepare() and autoExecute(). The $fields could be used for the "Where" clause...

Comments

 [2005-09-09 07:29 UTC] lsmith
Does DB have it? Can you write up a patch?
 [2005-09-09 16:47 UTC] jausions
I haven't check DB, but I don't recall seeing it. I'll try to write a patch, it shouldn't be too difficult.
 [2005-09-11 03:55 UTC] jausions
Ok, have a look at: http://www.11abacus.com/cvs/pear/MDB2_Extended.patch It's just a quick and dirty patch. I didn't want to spend too much time on it if it won't make it in... Thanks.
 [2005-09-11 07:39 UTC] at php dot net
Ok thx. The code seems like it would work. I personally do not use these methods, but it strikes me that the where support for UPDATE and DELETE should be the same to make usage more intuitive. Hmm so maybe we should bring the UPDATE support for WHERE genetation inline with what you have done here for DELETE. It seems more in the spirit of the method to use placeholders for the WHERE statement in UPDATE as well, rather than expecting the user to do this. Alternatively we could do an is_array()/is_string() check to determine if the WHERE is to be "imploded" or just "appended". So I guess in that case $table_fields would not be used at all in the delete mode. What do you say?
 [2005-09-12 17:54 UTC] jausions
Ok, I'll try to work another patch to have some consistency in the call. Probably will have to do some sort if is_string(key) then use key => value pair, otherwise "AND" append the value.
 [2005-12-04 12:20 UTC] lsmith
I do not consider this to be an important feature, so unless someone writes the code, along with some test cases I will not bother.
 [2006-05-20 10:57 UTC] lsmith (Lukas Smith)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.