常 迎辉 Sat May 19 07:16:37 -0400 2012

Subject: Undefined property

PHP Fatal error: Uncaught exception 'ActiveRecord\UndefinedPropertyException' with message 'Undefined property: News->ntitle in D:\wwwroot\php-activerecord\lib\Model.php on line 420' in D:\wwwroot\php-activerecord\lib\Model.php:420
Stack trace:
#0 D:\wwwroot\test_ar.php(25): ActiveRecord\Model->__set('ntitle', 'production')
#1 {main}
thrown in D:\wwwroot\php-activerecord\lib\Model.php on line 420

my table is
[ID] [int] IDENTITY NOT NULL,
[NTitle] [varchar](250) NULL,
[NContent] [text] NULL,
[PostTime] [datetime] NULL,
[PostEmp] [varchar](50) NULL,
[Hits] [int] NULL,
[Viewers] [varchar](500) NULL,

my model is
class News extends ActiveRecord\Model {
static $table_name = 'php_oa_news';
static $primary_key = 'id';
}

my code

//var_dump(News::first()->attributes());
$news= new News();
$news->ntitle="production";
$news->save();

I use sqlsrvadapter and ms sql server 2008, php 5.4 ;

var_dump(News::first()->attributes());
This code is working fine;