我得到這個錯誤在Zend框架: 完整性約束違規:1048列「url_id」不能爲空完整性約束違規:1048列「url_id」不能爲空
我的代碼是:
$stmt = $this->select()->where('url_address = ?', $url_address)->query();
$r = $stmt->fetchAll();
print_r($r);
if(count($r)==0){
$data = array(
'url_address' => $url_address,
);
$this->insert($data);
$stmt = $this->select()->where('url_address = ?', $url_address)->query();
$r = $stmt->fetchAll();
}
echo $r->url_id;
return $r->url_id;
你有沒有試過把東西放在'url_id'中? – 2011-05-05 17:48:13
url_id是自動遞增的,主鍵 – 2011-05-05 17:49:21
這不是那個錯誤說的... – 2011-05-05 17:49:43