Can you post the code you are using to retrieve and display the data?
On May 12, 3:17 pm, Site Reference <daoustm...@gmail.com> wrote:
> Hey all,
>
> I apologize if this is a bit of a newbie question, but I am having
> trouble getting my database associations to link up...here is what I
> have:
>
> MySQL Tables
>
> CREATE TABLE phones (
> id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
> profile_id INTEGER UNSIGNED NULL,
> phone VARCHAR(255) NULL,
> created INTEGER UNSIGNED NULL,
> modified INTEGER UNSIGNED NULL,
> PRIMARY KEY(id)
> );
>
> CREATE TABLE profiles (
> id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
> name VARCHAR(255) NULL,
> main_address VARCHAR(255) NULL,
> created INTEGER UNSIGNED NULL,
> modified INTEGER UNSIGNED NULL,
> PRIMARY KEY(id)
> );
>
> Here are my models:
>
> <?php
> class Phone extends AppModel {
> var $name = 'Phone';
> var $belongsTo = 'Profile';}
>
> ?>
>
> <?php
> class Profile extends AppModel {
> var $name = 'Profile';
> var $hasMany = 'Phone';}
>
> ?>
>
> I am using scaffolding for the controllers. Cake seems to see the
> relationship, but is not listing phones in the profiles. Is there
> anyway that I can do this, or is the fact that there are many phone
> numbers to a profile a problem?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---