我的控制器功能,
$this->ProjectLog->project_id = $this->task_project_id;
$this->ProjectLog->detail = "test string";
$this->ProjectLog->create();
log_message("error", "query: " . $this->db->last_query());
我的模特函数,
public function create(){
$this->db->insert("ProjectLog", $this);
return;
}
我的日志文件是
ERROR - 2012-08-06 13:24:13 --> query: INSERT INTO `ProjectLog` (`id`, `project_id`, `detail`) VALUES (NULL, '2', 'test string')
但是我的ProjectLog表是空的。当我从错误日志中复制查询并粘贴mysql控制台时,它就可以了。