How to add a field in the dataabse with install function for a plugin I am creating.
tonoshi Offline
Junior Member
**
Posts: 23
Joined: Aug 2010
Post: #1
How to add a field in the dataabse with install function for a plugin I am creating.
Hello. I am creating my first plugin ever for mybb and I have gotten everything to work with the exeption of adding a field in the forums table.

The query I am trying to add is this:

PHP Code:
UPDATE 'mybb_forums' ADD 'forum_ignore' INT(1) NOT NULL DEFAULT '0'


When I run this query at the database my plugin works as it should. Howeevr I want to add it automatically with the install function in the plugin file. After I studied some plugins I tried this but it did not work.

PHP Code:
function forumsignore_install()
{
global $db;
$db->write_query("UPDATE ".TABLE_PREFIX."forums ADD 'forum_ignore' INT(1) NOT NULL DEFAULT '0'");		
}


Can someone please show me what I am doing wrong and how to fix it?

Thank you Smile

08-04-2010 10:09 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
How to add a field in the dataabse with install function for a plugin I am creating. - tonoshi - 08-04-2010 10:09 PM

 Standard Tools
Forum Jump: