MyBB Community Forums
Inserting a Collumn into a Table (DB) - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: Inserting a Collumn into a Table (DB) (/thread-185533.html)



Inserting a Collumn into a Table (DB) - Nineteh - 2015-10-23

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


RE: Inserting a Collumn into a Table (DB) - dragonexpert - 2015-10-23

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");