Belong to

If i have the following tables

student have many project but we specialize the graduation project and but its id in

student table

Student

id

idofgraduationproject foreign key to id of project

project

id

filename

projectid

when i enter new user i use filefiled to attach the project but i wante save its name and project id in table project and fileid in table student

how i can do it?

could you be more specific? and attach database schema in order the other to be possible to help.

Take a look at this extension:

http://www.yiiframework.com/extension/cadvancedarbehavior/

Looks like its what you need.