MyBB Community Forums

Full Version: Work with MySQL MariaDB STRICT
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I am a subscriber at the forums.mybb-plugins and the plugin author for Newpoints gave me Shop 1.9 to see if the problem can be fixed with the modification of the code. I guess my server refuses to create tables for the plugin. I have no issue and I install plugins correctly. I been having this dilemma for a few days now. I really need the shop plugin for the site. I even contacted my host and they told me to go to phpBB lol. Is there anything special I need to know with plugins for the MariaDB for MyBB?

http://www.bigbrotheronline.xyz (my site work tho, just for support purposes)
There shouldn't be anything specific for MariaDB, it's more that some plugins aren't tested in strict mode (MySQL or MariaDB), and don't always work. Without looking at the code for the plugin (I don't know where the shop plugin is), I can't see why it wouldn't create the table, but could you not just run the query manually in phpMyAdmin, or an equivalent?
I am not sure how to run it when the tables don't exist. Unless I am not doing it correctly. Thank you for your response.
What I mean is the query to create the table would be in the plugin file, so it can just be run manually... but if there were an actual error with the query, it would surely error. I don't know how or when the table is supposed to be created as I don't know how the plugin works, but if you can link to it, I can find the query and you can just run it manually.
[Image: 19f35dadfcea4931b65fa7bdbbc6ff49.png]

Am I doing this correctly?
You don't need any of the PHP around it - start with CREATE TABLE and end with MyISAM (don't need the " at the start or end). Also change

".TABLE_PREFIX."

to just mybb_
CREATE TABLE . mybb_."newpoints_shop_categories` (
  `cid` bigint(30) UNSIGNED NOT NULL auto_increment,
  `name` varchar(100) NOT NULL default '',
  `description` text NOT NULL,
  `visible` smallint(1) NOT NULL default '1',
  `icon` varchar(255) NOT NULL default '',
  `usergroups` varchar(100) NOT NULL default '',
  `disporder` int(5) NOT NULL default '0',
  `items` int(10) NOT NULL default '0',
  `expanded` smallint(1) NOT NULL default '1',
  PRIMARY KEY  (`cid`)
 ) ENGINE=MyISAM");
Like this?:


orginial:
$db->write_query("CREATE TABLE `".TABLE_PREFIX."newpoints_shop_categories` (
  `cid` bigint(30) UNSIGNED NOT NULL auto_increment,
  `name` varchar(100) NOT NULL default '',
  `description` text NOT NULL,
  `visible` smallint(1) NOT NULL default '1',
  `icon` varchar(255) NOT NULL default '',
  `usergroups` varchar(100) NOT NULL default '',
  `disporder` int(5) NOT NULL default '0',
  `items` int(10) NOT NULL default '0',
  `expanded` smallint(1) NOT NULL default '1',
  PRIMARY KEY  (`cid`)
 ) ENGINE=MyISAM");
Almost:

CREATE TABLE `mybb_newpoints_shop_categories` (
  `cid` bigint(30) UNSIGNED NOT NULL auto_increment,
  `name` varchar(100) NOT NULL default '',
  `description` text NOT NULL,
  `visible` smallint(1) NOT NULL default '1',
  `icon` varchar(255) NOT NULL default '',
  `usergroups` varchar(100) NOT NULL default '',
  `disporder` int(5) NOT NULL default '0',
  `items` int(10) NOT NULL default '0',
  `expanded` smallint(1) NOT NULL default '1',
  PRIMARY KEY  (`cid`)
 ) ENGINE=MyISAM
Yay it work! I repeated the query for the items because it didn't exist either. Now I am getting this error for adding an item:

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1054 - Unknown column 'price' in 'field list'
Query:
INSERT INTO mybbe2_newpoints_shop_items (`name`,`description`,`icon`,`visible`,`disporder`,`price`,`infinite`,`stock`,`limit`,`sendable`,`sellable`,`cid`,`pm`,`pmadmin`) VALUES ('test','','',1,0,'0',1,0,0,1,1,1,'','')
Please contact the MyBB Group for technical support.
That sounds more like a bug with the plugin then, it hasn't created the price column.

Where is the shop plugin available so I can take a look?
Pages: 1 2