Since you are using "non-standard" names for your ID columns, you need to specify $primaryKey in your models, so your Person model, you would need:
$primaryKey = 'location_id'; If you set debug to 2 or 3, you'll see the queries being executed. You may need to set recursive to get the non-related data too, see: On Jan 8, 8:09 am, Ernesto <e.fanz...@gmail.com> wrote: > Hello. > > i have 3 models > - Person > - Location > - Location_Type > > pointing respectively @ 3 tables: > > Persons: > person_id > name > surname > > Locations: > location_id > person_id > location_type_id > address > country > > Location_Types: > location_type_id > description > > the 3 models are linked as follow: > Person hasMany Location > Location belongsTo Location_Type > > here's the models' code > > class person extends AppModel { > var $hasMany = array( > "Locations" => array( > "className" => "Location", > "foreignKey" => "location_id", > "dependent" => "true" > ) > ); > > } > > class location extends AppModel { > var $belongsTo = array( > "Location_Type" => array( > "className" => "LocationType", > "foreignKey" => "location_type_id", > "dependent" => "true" > ) > ); > > } > > I can't find out why the "Location_Type"'s data is not showing when i > load data from the "Person" model --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---