Welcome Guest, Not a member yet? Register   Sign In
Entity or Model Default null for all Empty fields
#1

I am new to Codeigniter currently trying to learn and building an testing application i have used Model & Entity classes 
how to make default null value for empty fields during insert & update records
Reply
#2

The database field has to allow null values, if it's set to not null then it will not except a null value.

Set the database field name to null to allow null values then it will except them.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

check migration table, set default value and allow null
Code:
[ 'type' => your_type , 'null' => true, 'default' => your_default_value]

or just edit table (example phpmyadmin) to set allow null and set default value
Reply




Theme © iAndrew 2016 - Forum software by © MyBB