direct data retrieval from database

Hi All

I am new to yii and php and even the web development. I am creating my first web application with very less knowledge about yii and php.

I want a drop-down list in my form. The data in the drop-down have to be directly retrieved from the database, which I am facing the main problem, as I have not created its model class. Then I want another drop-down list to populate based on the selected value of the former drop-down value. It is like select state then on the basis of state value city value have to be populated.

Please help me with it. And if possible please explain in detail.

Thank u in advance…


refer below link

you have make array like


[1] = abc

[2] = xyz




Thanks for the reply, But can you explain it further as I am totally new to these things and I did not understood the CSS in link you provided.

My current scenario is that I am using CActiveForm widget and in that I have to fill state and city.

My State table is described as State(id,name) and my city table is described as City(id,name,state_id).

Now I have not made there model class. And i want to make a dependent drop down list.

How can I achieve this.

Thanks again.

finally problem solved.

Evrything given in this article Creating dependent drop down list