Welcome Guest, Not a member yet? Register   Sign In
DBFORGE add field zerofill
#1

Hi,

I would like to create a table with a field tinyint(2) unsigned zerofill. When I try the statement below column is created but zerofill don't work. 

'month' => array(
                    'type' => 'TINYINT',
                    'constraint' => '2',
                    'unsigned' => TRUE,
                    'zerofill' => TRUE)


Do you have the solution ? Is my syntax correct ?

Thanks
Reply
#2

DBForge does not have a zerofill parameter according to the documentation.
What did you Try? What did you Get? What did you Expect?

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

(This post was last modified: 02-17-2018, 10:42 AM by Avenirer.)

Just do it manually: 
PHP Code:
$this->dbforge->add_field("month TINYINT(2) UNSIGNED ZEROFILL NOT NULL"); 
Reply
#4

Hello,
I solve this problem setting ZEROFILL after field type and lenght, like this:

$fields= array(
'month' => array(
'type' => 'TINYINT(2) ZEROFILL',
'unsigned' => TRUE)
);
Reply




Theme © iAndrew 2016 - Forum software by © MyBB