when i use relations (call field relation table) is error.


class Province extends CActiveRecord

{


 ...........

 ...........


	public function relations()

	{

		// NOTE: you may need to adjust the relation name and the related

		// class name for the relations automatically generated below.


        /*        ทดสอบ 1 to 1      */


		return array(

            'slogan'=>array(self::HAS_ONE, 'slogan', 'provinceID'),

            'districts'=>array(self::HAS_MANY, 'district', 'provinceID'),

		);

	}




 ...........

 ...........

}

And


class District extends CActiveRecord{

.....

.....


	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(

            'provinces'=>array(self::BELONGS_TO, 'province', 'provinceID'),

		);

	}


.....

.....

}

i test in localhost is work. (Xampp WindowsXP)

what happend on server of me is error.

http://dev.bungkhan.com/province/district/index

is error or page use relations.

other is work (don’t use relations). http://dev.bungkhan.com/province

Thank you. ขอบคุณครับ

:lol: i try to sol this error.

it is case sensitive.


            'provinces'=>array(self::BELONGS_TO, 'province', 'provinceID'),

but in models is Province.php


            'provinces'=>array(self::BELONGS_TO, 'Province', 'provinceID'),

at present is work.

:D