GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Mysql question: Why set a length for Int? (https://gfy.com/showthread.php?t=526503)

mrthumbs 10-10-2005 03:41 PM

Mysql question: Why set a length for Int?
 
Unlike Varchar setting a length for Int doesnt change anything.

Int(1) and Int(999) both store 2 billion numbers.. so whats the reason
for Mysql saving Length data?

studiocritic 10-10-2005 04:23 PM

Quote:

Originally Posted by mrthumbs
Unlike Varchar setting a length for Int doesnt change anything.

Int(1) and Int(999) both store 2 billion numbers.. so whats the reason
for Mysql saving Length data?

INT actually holds 4 billion - http://dev.mysql.com/doc/mysql/en/numeric-types.html..

The reason is just for display when you SELECT it, the number 4 in INT(4) is how wide the column will be.


All times are GMT -7. The time now is 09:25 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123