Monday, February 20, 2012

Reading name using city_id in the user (main) tabl, Reading name from id in the main table(controller)

Hi
I want to use cakephp model behaviour to do this. Can you help?

I have a user table which stores id(s) for city, secretquestion etc.,
so my 'user' table has city_id and secretquestion_id and the actual
names/texts for these are stored in City & Secretquestion tables
respectively.

Now, I am coding UsersController. When I read my User table, I get
these IDs obviously. But I need to retrieve these names (City Name,
Secretquestion Text) for subsequent use.

How can I do that? Can someone shed light on the steps involved?

I can simply write a SQL and do that but I want to utilize CakePHP
Model functionality and handle this the CakePHP way.

Thanks
-BC

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate