Jump to content

BIGINT error


Sniffy

Recommended Posts

Ok, so i am trying to insert columns into my database that can handle large numbers like 1 million. On the mySQL manual it says BIGINT can handle really large numbers.So on PHPMyAdmin I tried to insert those columns (level, exp, reqExp) into the "basicUserInfo" table to hold max values of 10000, 1000000, 1000000, into the table with the attribute of BIGINT. I get this error:SQL query: ALTER TABLE `basicUserInfo` ADD `level` BIGINT( 10000 ) NOT NULL AFTER `eyeColor` ,ADD `exp` BIGINT( 1000000 ) NOT NULL AFTER `level` ,ADD `reqExp` BIGINT( 1000000 ) NOT NULL AFTER `exp` MySQL said: #1074 - Column length too big for column 'level' (max = 255); use BLOB or TEXT instead

Link to comment
Share on other sites

Its all the same apparently, its just the length of the number. It cant be above BIGINT(255), you are trying to do BIGINT(1000000) and such, not do-able.

Link to comment
Share on other sites

The number you give in the parantheses isn't the max. number, it's the number of digits that the number can contain (or the length of the number.Ex:if you set it to 3 the biggest number you can have is 999if you set it to 4 the biggest is 9999 etc.

Link to comment
Share on other sites

Thanks guys.And one more SQL question.What is the difference between setting a column to NULL and NOT NULL?If it is a NULL column does that mean I can't store information?

Link to comment
Share on other sites

NULL means that the field can be null, NOT NULL means that it can't be null...NULL > The field is allowed to be null/emptyNOT NULL > The field isn't allowed to be null/emptyIt wouldn't be very usefull to have fields that you can't store anything in, would it!?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...