pollux1er
I'm working on a database for a script I'm writing and I am wondering what is the difference between the UNSIGNED and UNSIGNED ZEROFILL attributes for column type?
Thanks in advance for any help.
Thanks in advance for any help.

What is the difference between UNSIGNED and UNSIGNED ZEROFILpollux1er
I'm working on a database for a script I'm writing and I am wondering what is the difference between the UNSIGNED and UNSIGNED ZEROFILL attributes for column type?
Thanks in advance for any help. rvec
unsigned means you can't go negative (0...n instead of n...n). The sign is the leading bit specifying if a number is positive or negative. By having an unsigned number you'll have one more bit and thus double the possible numbers. So for a signed 3 bit number the first bit would be used for pos/neg and the other two for the actual number (4...4) if it where unsigned you could count higher (0....
Zerofill means the number will be filled with zeroes from the left (00027 instead of 27 if the length is 5). jmraker
According to http://kimbriggs.com/computers/computernotes/mysqlnotes/mysqldatatypes50.file
ZEROFILL will prepend zeros to a number as 000012 instead of just a normal 12. If the padded numbers are passed to a program, it would have to be as a string. I don't know if they are. badai
it wouldn't be string. if you fetch 0000008 from db, the program will always treat it as 8, unless you explicitly fetch it as string in your sql.
Related topics
