My app structure is as flows
–tabels–
image
id fileName comment date
page
id pageName comment date
content
id pageID imageID date
Is a simple app displaying images
sql query for displaying one page images is
SELECT i.* FROM image as i
INNER JOIN content as c on i.id = c.imageID
INNER JOIN page as p on i.id = c.pageID
WHERE p.pageName = ‘HMNO’
But i want to try Yii active but just don’t get it!
so far i have
class image
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'content'=>array(self::BELONGS_TO, 'content', 'imageID')
);
}
pleas help me
thanks