• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.