Sorry to say Anand, but your schema does not conform to what CakePHP
expects, which makes it difficult to make it work with CakePHP,
without specifying a lot of information.

Suggest you rethink your schema, so that:
1) It conforms to CakePHP (table names plural, foreign keys equal
foreign key table name singular + underscore + 'id', etc.;
2) Makes use of primary key auto numbering;
3) Each table has its own primary key (id) - not depending on another
tables primary key (id);
4) Tinyint is only for boolean columns (true/false)!

This will make it a lot easier to use by CakePHP and for the future
maintenance!

I myself would not consider using your schema! Use my previous post as
a base for replanning your schema.
Enjoy,
   John

On Dec 3, 7:42 am, anand angadi <anuang...@gmail.com> wrote:
> Hi john,
>
> No... here is table script attached... please take a look at it...u wil get
> an idea...
>
> Cheers:
> Anand
>
> On Wed, Dec 2, 2009 at 4:46 PM, John Andersen <j.andersen...@gmail.com>wrote:
>
> > Looks confusing, sorry :)
>
> > Trying to transform your tables into a workable ER model (not CakePHP
> > model):
>
> > A user may have one or more phone numbers
> > A user may have one or more addresses
> > Each phone number belongs to one user
> > Each address belongs to one user
> > An address may have one or more details
> > A detail belongs to one address
>
> > Tables:
> > users
> > - id (primary key, auto number)
> > - other necessary columns that you may require.
> > - created
> > - modified
>
> > phonenumbers
> > - id (primary key, auto number)
> > - user_id (foreign key to table users)
> > - other necessary columns that you may require.
> > - created
> > - modified
>
> > addresses
> > - id (primary key, auto number)
> > - user_id (foreign key to table users)
> > - other necessary columns that you may require.
> > - created
> > - modified
>
> > addressdetails
> > - id (primary key, auto number)
> > - address_id (foreign key to table addresses)
> > - other necessary columns that you may require.
> > - created
> > - modified
>
> > Do I understand your schema correctly?
> >   John
>
> > On Dec 2, 11:11 am, anand angadi <anuang...@gmail.com> wrote:
> > > Hi John,
>
> > > Sorry here its attached now...
>
> > > Cheers:
> > > Anand
>
> > >  shcema.bmp
> > > 1299KViewDownload
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.com>For
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
>
>
>
>  main.sql
> 5KViewDownload

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to