I am getting this error in Zend Framework: Integrity constraint violation: 1048 Column 'url_id' cannot be null
My code is:
$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
? – Ignacio Vazquez-Abrams