Yii is fun. If you understand it. I try to understand it everyday, so I will write about it from time to time.
How to get only 1 result from any table in your project using ID?
NameOfTable::model()->search criteria->columne nameex:
TestPack::model()->findByPk(1)->name //means: in table TestPack find row with id 1 and show it's nameFun starts, when you need to do more complex requests - then you can chain requests:
TestPack::model()->findByPk(Test::model()->findByPk($_GET['id'])->test_pack_id)->name
Brak komentarzy:
Prześlij komentarz