Thanks for your response but after posting I was too impatient and jumped unto the irc channel. I'm posting the solution here to help the newbies like myself who might not readily take advantage of debug options.
The real problem was my foreign key names. for example I had "Locations_id". What I've found out is that it should have been "Location_id". Singular not plural. The documentation hints at it but doesn't say so explicitly. When you look at cake's logic it even makes more sense. I only realized that after someone told me to turn my cake debug level up a notch. Then I saw the erroneous sql statements that were being sent. Apart from the documentation needing some more comprehensive coverage I've found the cake community very helpful. And newbies like myself should use them and other sources like tutorials. And use debug. The only problem left was that I couldn't find a way to "insert the $25" the guy who helped me asked for. heh Felix Eric C Blount wrote: > Either hasOne or hasMany, yes. I believe that associations have to go > both ways in order to work correctly. For instance, if you use > recursive = 1 and query taxes, it should give you the > relevant locations, but querying locations will not give you taxes > unless you set up the reverse association. > > HTH, > Eric > > > On 2/16/07, *Felix St. Bernard* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > > I'm a little confused here.... > > I have 2 tables "Taxes" and "Locations" > > Table Tax has a foreign key called 'locations_id' and in it's > model I've > defined a belongsTo association "var $belongsTo = 'Location';" I'm > using > scaffolding for the time being to get my relations in order. However > this association shows no indication that it's working. What other > association would I need to define? Would I need to define a Location > hasOne Tax?..... > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
