Query not writing
#1
I tend to stick to theme designing, but thought I'd give plugins a go. At the moment I'm attempting to write an array and just a usual query to the database but not having much luck. The array I'm doing is within plugin activation and it's to create a new group. Is there an easier way to do this? At the moment I've just named the array and gone through the structure of the usergroup table (type, title, description, namestyle etc.) and then used the following to try and write it to the usergroups table:

$db->insert_query('usergroups', $random_create_groups);
  rebuild_settings();

I'm having a similar problem with the following bit of code too (won't query to database):
// Reset
function random_reset() {
  global $db;
if ($mybb->settings['random_reset'] == 1){
$db->write_query("UPDATE TABLE ".TABLE_PREFIX."settings SET value='' WHERE name='random_userbar'");
$db->write_query("UPDATE TABLE ".TABLE_PREFIX."settings SET value='1' WHERE name='random_uid'");
$db->write_query("UPDATE TABLE ".TABLE_PREFIX."settings SET value='0' WHERE name IN('random_enable', 'random_reset')");
rebuild_settings();
}
}

Random_reset is a setting created in the plugin activation which produces a yesno option on the settings page. Any possible solutions?
Plugin Count: I lost count.
Public Plugins are available here.
Official GitHub.
Please do not PM me for support unless asked to.
Reply


Messages In This Thread
Query not writing - by Wires - 2017-07-29, 10:11 PM
RE: Query not writing - by Whiteneo - 2017-07-30, 01:05 AM
RE: Query not writing - by Wires - 2017-07-30, 01:22 AM
RE: Query not writing - by Whiteneo - 2017-07-30, 01:30 AM
RE: Query not writing - by Wires - 2017-07-30, 02:07 AM
RE: Query not writing - by fizz - 2017-07-30, 08:12 AM
RE: Query not writing - by Wires - 2017-07-30, 10:17 AM
RE: Query not writing - by chack1172 - 2017-07-30, 10:27 AM
RE: Query not writing - by Wires - 2017-07-30, 10:31 AM
RE: Query not writing - by fizz - 2017-07-30, 11:49 AM
RE: Query not writing - by Wires - 2017-07-30, 12:03 PM
RE: Query not writing - by Whiteneo - 2017-07-30, 06:35 PM
RE: Query not writing - by Wires - 2017-07-31, 03:33 AM
RE: Query not writing - by Whiteneo - 2017-07-31, 03:50 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)