MyBB Community Forums

Full Version: Reputation doesn't show
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I ran this code in phpMyAdmin i got from dragonexpert666

ALTER TABLE mybb_users MODIFY COLUMN reputation VARCHAR(50)

After that, all the new registered users doesn't have any reputation (It shows blank instead of 0)

Help anyone?
Reputation should be 'bigint(30)'

Try running?

ALTER TABLE mybb_users MODIFY COLUMN reputation bigint(30)
dragonexpert*

Well, the column shouldn't surely be varchar because an integer is saved there. So it should be either int or bigint:
ALTER TABLE mybb_users MODIFY COLUMN reputation int NOT NULL default 0

Also, after the incorrect change you may need to regain old values from a backup or with mybb_reputation table SUM queries for each user.
VARCHAR still accepts integers.

Quote:Holds a variable length string (can contain letters, numbers, and special characters). The maximum size is specified in parenthesis. Can store up to 255 characters. Note: If you put a greater value than 255 it will be converted to a TEXT type
Source: http://www.w3schools.com/sql/sql_datatypes.asp
(2014-07-15, 07:55 PM)Destroy666 Wrote: [ -> ]dragonexpert*

Well, the column shouldn't surely be varchar because an integer is saved there. So it should be either int or bigint:
ALTER TABLE mybb_users MODIFY COLUMN reputation int NOT NULL default 0

Also, after the incorrect change you may need to regain old values from a backup or with mybb_reputation table SUM queries for each user.

Thank you, that fixed it! Smile

Solved.
If I understand this right a VARCHAR will hold it as a STRING, meaning it would have to be casted to a int for mathmatical equations on it? Could be the reason it showed nothing since you cant do math on strings unless it is type casted?

Or is there something different? Just want to know for future.
(2014-07-15, 09:13 PM)dragonexpert Wrote: [ -> ]VARCHAR still accepts integers.

Quote:Holds a variable length string (can contain letters, numbers, and special characters). The maximum size is specified in parenthesis. Can store up to 255 characters. Note: If you put a greater value than 255 it will be converted to a TEXT type
Source: http://www.w3schools.com/sql/sql_datatypes.asp

Still, I don't see any reason to change it. Especially that there may be queries which do math equations when updating reputation column (I'm writing one for client atm).