> i agree. but whay is it generating "WHERE `id` IN (21)" instead of > "WHERE `id` = `21`"? is it something to do with my model? there are > some belongsTo and hasMany interactions. could that be messing with > this if i have not set them up correctly?
Backticks are used for quoting field and table names (and aliases), not values. Still, the difference between "WHERE `id`=21" and "WHERE `id` IN(21)" is zilch - the database optimizer will sort this out on its first pass. This is not your problem. > the table has been changed, but it now shows the field i was trying to > change has been changed to the name of page's icon (sp2.ico). > subsequent attempts to change the field give the same output in all > responses, but i always get "sp2.ico" as the text in the field. What's you view code? That's probably where the issue is - since your dump shows the correct value. On Feb 21, 2:14 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On Thu, Feb 21, 2008 at 2:21 AM, geordie <[EMAIL PROTECTED]> wrote: > > > i agree. but whay is it generating "WHERE `id` IN (21)" instead of > > "WHERE `id` = `21`"? is it something to do with my model? there are > > some belongsTo and hasMany interactions. could that be messing with > > this if i have not set them up correctly? > > Maybe, just maybe, here is a possible explanation > > 1) CakePHP needs to be able to do UPDATE statements involving one or > more conditions > 2) Why write code for doing an update with one condition and another > for multiple conditions? > > The only thing that matters here is this: Is it correctly updating > the record? Seriously, that's the only thing that matters. Yes, I > agree that 'WHERE id IN (21)' is not your typical condition for an > UPDATE statement. > > If you disagree with this decision, then by all means file a ticket > over at trac.cakephp.org about it. > > -- > Chris Hartjes > Internet Loudmouth > Motto for 2008: "Moving from herding elephants to handling snakes..." > @TheKeyBoard:http://www.littlehart.net/atthekeyboard --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---