Hendrickson Posted August 31, 2011 Share Posted August 31, 2011 Hi guys I'm hoping someone has already had this issue and has a fix? I'm not too up with my sql, I took a basic course years ago. Anyway...The issue is one gang in my game has reached the int char limit and locks at 2147483647. This is a sql issue. I think the field should be bigint. How to I go about this and change all the gangMoney fields from int values to bigint? Are there issues in doing this? I noticed that player money users bigint and not int. Silly really as gangs in a popular gang could end of with a lot of cash so it should have been bigint to begin with. The error is: Warning: #1264 Out of range value adjusted for column 'gangMONEY' at row 1 Quote Link to comment Share on other sites More sharing options...
Lithium Posted August 31, 2011 Share Posted August 31, 2011 ALTER TABLE `gangs` CHANGE `gangMONEY` `gangMONEY` BIGINT( 20 ) NOT NULL DEFAULT '0' Quote Link to comment Share on other sites More sharing options...
Spudinski Posted September 1, 2011 Share Posted September 1, 2011 There are no issues in doing this, since the table really just holds the data. Type declarations are held elsewhere. Using the above query in PHPMyAdmin should be sufficient, and allow up to 20 positive digits when UNSIGNED but only 19 when SIGNED(because it allows negative integers). SIGNED range: -9223372036854775808 to 9223372036854775807 UNSIGNED range: 0 to 18446744073709551615 Depending on your current type declarations, I would suggest you use the following to make sure it is a) UNSIGNED, and b) set to BIGINT. Also, the above CHANGE would still allow negative integers, which is a flaw. ALTER TABLE `gangs` MODIFY `gangMONEY` BIGINT UNSIGNED; Please use "EXPLAIN `gangs`" to confirm the modification. It should read "bigint(20) unsigned" in the type column shown at output. 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.