Crud: Relationship Database

hi,

I am developing a crud it relates to various tables.

I need to know how to insert and display this information in the database.

i need insert information tabular in my database.

I saw in the tutorial for an item and use tabular database, I believe this answer:

http://www.yiiframework.com/doc/guide/1.1/pt_br/form.table

http://www.yiiframework.com/doc/guide/1.1/pt_br/database.ar

But in practice I do not know how to apply it.

Ex:

one siple relation in database:




create table curriculo (id int not null auto_icrement, name, age, profission, primary key(id));

create table curriculolist (id int not null auto_icrement, curriculo, idcurriculo, primary key(id));



View that I created a relationship with my database, id = idcurriculo.

I need to create a way where the User in a form dynamically insert various curriculos.

How to use the tutorials above to make these relationships?

In models/curriculo.php add the relation as below




public function relations() {

        return array(

            'curriculo' => array(self::BELONGS_TO, 'curriculo', 'id'),

        );

    }



In models/curriculolist.php add the relation as below




return array(

            'Curriculo' => array(self::HAS_ONE,'Curriculo', 'idcurriculo'),

        );