I have a field called
NUMBER is int(8) Unsigned Zerofill Not Null
alter table test modify number int(8) signed zerofill not null
alter table test modify number int(8) zerofill not null
alter table test modify number int(8) signed not null
If you specify
ZEROFILLfor a numeric column, MySQL automatically adds the
UNSIGNEDattribute to the column.
Reported as a bug in 2006, closed as "Not a Bug". https://bugs.mysql.com/bug.php?id=24356
Re your comment:
So does this mean no one out there has negative zero filled data in a mysql database?
Right. The most common use case for ZEROFILL is to make sure things like zip codes or bank account numbers use a fixed number of digits. These cases don't support negative values anyway, so why bother with ugly strings like -00001234?
can you convert it to zerofilled with PHP?
Yes, you can format numbers with zero-padding in PHP.
<?php $n = -1234; printf("Number is %08d\n", $n);
Number is -0001234
Read http://php.net/manual/en/function.sprintf.php for more neat formatting things you can do with