I am inserting values from a form in a MySql table. The problem is when I leave one input field empty (it is a primary key), the db does not complain that the primary key is empty and the row is added to the table with an empty space in the primary key column.
$this->vendor_name = empty($params['name'])? $params['name']:null;
So in my case name is empty and I am inserting a NULL in the primary key but there is no warning from the db.