Jump to content
MakeWebGames

Gang money reached int 15 char limit fix? Warning: #1264 Out of range value


Hendrickson

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...