MyBB Community Forums

Full Version: Inserting a Collumn into a Table (DB)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I have asked many DB questions like this before and I appreciate all the information you have given me!

I was just wondering how I can insert a collumn into the mybb_users table which holds:


rank VARCHAR(120) NOT NULL

I have checked myBB documentation as always and here is my best guess:
$db->add_column("`mybb_users`, VALUES(
	`rank` VARCHAR(120) NOT NULL,
	)");

Thanks In advance for the solution!
<3
The table prefix is automatically applied so you can just put "users" as the first argument. Argument two is the column name, and the final is the definition. Therefore:

$db->add_column("users", "rank", "VARCHAR(120) NOT NULL");