MyBB Community Forums

Full Version: Insert column into mybb_users
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

How do I insert a column into the mybb_users table?

I've already installed MyBB and I am able to register and login and receive email verification.

Could someone perhaps guide me to login to MyBB using MySQL as well?

Looking forward to speaking with someone

-Joseph
I don't know why you would want to add a column to a table, unless you are making something custom, but you can do this.

ALTER TABLE `mybb_users` ADD COLUMN `YOUR COLUMN HERE` INT(10) AFTER `loginattempts`;
If it's for a plugin you wish to create I'd use the add_column method of the $db class.
$db->add_column("users", "newcolumn", "column_definition");

By using that method it is more consistent on how queries are done in MyBB.

As for your question about logging in, use the validate_password_from_username function. Make sure you use require_once oninc/functions_user.php.