2014-10-14 00:54:36 2451次浏览 0条回答 0 悬赏 0 金钱

Call to a member function getDb() on a non-object in framework/db/ar/CActiveRecord.php

代码如下:

$yii='./framework/yii.php';
require_once($yii);

class User extends CActiveRecord{
	var $primaryKey = 'code';
	
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}
	public function tableName()
	{
		return 'user_tb';
	}
}


$user = new User();

$user->user_name = "test";
$user->pwd = "test";

$user->save();
    没有找到数据。
您需要登录后才可以回答。登录 | 立即注册
lincent
实习生

lincent

注册时间:2014-10-14
最后登录:2014-10-14
在线时长:0小时21分
  • 粉丝0
  • 金钱0
  • 威望0
  • 积分0

热门问题