Hi, Yes, businesses table has id (PK), name, account_id and a whole heap of other fields. The accounts table only has id (PK), name, and testing if I have it there (I don't really want it, it's just for testing)
Cheers ;) ________________________________ From: ramonmaruko <[email protected]> To: CakePHP <[email protected]> Sent: Saturday, 14 February, 2009 5:11:42 PM Subject: Re: What's wrong with my associations ? Does your 'businesses' table have at least the following fields columns: id (PRIMARY KEY) name account_id and the accounts table: id (PRIMARY KEY) name On Feb 14, 1:33 pm, Chris Mc <[email protected]> wrote: > OK, so I thought I had the association (ie relationship) part pretty > much sorted, and I'm following the logic that I used before when > creating a State/City example and it's working great most of the time. > But I have this problem, and I'm not sure why: > > In English terms, a Business can have an Account (basically what type > of account do they have) and they can only ever have one Account at > any one time. > > So, I say that the business Model 'belongs to' an Account, and an > Account 'has many' Business. The Account model has only 1 attribute > called name, and when I build the project and go to add a new Account > there is no textbox to enter into :(. While trying to debug the > problem I created another string attribute on Account called testing > and when I build and add a new account, I only get a textbox for > testing (still nothing for name). > > IMHO, the Account/Business association is created exactly the same as > the State/City association and State/City works fine. But I've also > noticed (this may not be related at all) is that I can't add a new > business, I always get the error "Business Could Not Be Saved" > > Any ideas what's wrong ? Make Yahoo!7 your homepage and win a trip to the Quiksilver Pro. Find out more --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~----------~----~----~----~------~----~------~--~---
