ActiveRecord类文档:http://www.yiiframework.com/doc/guide/1.1/en/database.ar 对于一个Model Post 有如下的4中查询方法,返回对象或者对象数组. // find the first row satisfying the specified condition // find the first row satisfying the specified condition $post=Post::model()->find…
1. 存取数据库方法存储第一种(SAVE )存表时候用到 例子: $post=new Post;$post->title='sample post';$post->content='content for the sample post';$post->createTime=time();/$post->createTime=new CDbexpression_r('NOW()');$post->save(); $user_field_data= new user_fie…