grlayouts Posted April 25, 2007 Share Posted April 25, 2007 the maximum number of $stat['cash'] i can hold in my database is 2147483647. how can i increase that? Quote Link to comment Share on other sites More sharing options...
sw0o0sh Posted April 25, 2007 Share Posted April 25, 2007 make the row type text or varchar(255) ? Quote Link to comment Share on other sites More sharing options...
Guest Posted April 25, 2007 Share Posted April 25, 2007 You will want to change the datatype of the column that holds that value to a: UNSIGNED INT or BIGINT I'd go with unsigned int IF the values won't go into the negatives. These are the minimums and maximums of these datatypes. I'm guessing your current datatype is of type INT. INT - -2147483648 to 2147483648 UNSIGNED INT - 0 to 4294967295 BIGINT - -9223372036854775808 to 9223372036854775807 You could do varchar or text as sw0o0sh suggested. But seeing that the data you are storing there is a numerical value, it might be better optimized and faster to use one of the above mentioned numerical datatypes. Quote Link to comment Share on other sites More sharing options...
taith Posted April 25, 2007 Share Posted April 25, 2007 varchar(255) would allow it to go upto a HUGE number... but if you switch it to a text field, it should be able to hold indefinatly HUGE numbers... however... i doubt you'd need that many figures for cash Quote Link to comment Share on other sites More sharing options...
Guest Posted April 25, 2007 Share Posted April 25, 2007 BIGINT would satisfy your needs, and at the same time be a lot better than varchar or text. You're dealing with numbers, numeric datatypes are best for numbers. If you need larger than an UNSIGNED BIGINT (maximum is: 18446744073709551615), then it would probably be faster to segment the total between more than one row or something of the sort. BIGINT fields are 8 bytes And UNSIGNED INT fields are 4 bytes. TEXT fields are 2 bytes + the length of the string VARCHAR fields is 1 byte + the length of the string Logically, if the digits go over 4 or 8 digits, which it has, then it would be better to use UNSIGNED INT or BIGINT, respectively. Quote Link to comment Share on other sites More sharing options...
grlayouts Posted April 25, 2007 Author Share Posted April 25, 2007 thanks again guys as always. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.