MyBB Community Forums

Full Version: SQL Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello!

When I've clicked on "Activate" near to the plugin Thread Restriction, the system said:

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's of usergroups banned','text',' ','2','124')' at line 3
Query:
INSERT INTO mybb_settings (sid,name,title,description,optionscode,value,disporder,gid) VALUES ('','threadrestriction_bangroups','Usergroups Banned','Enter the id/'s of usergroups banned','text',' ','2','124')
Please contact the MyBB Group for technical support.


How fix?


Link files > https://www.dropbox.com/sh/glfab3qws5hkn...rX8na?dl=0
Change

"Enter the id/'s of usergroups banned"

to

"Enter the id\'s of usergroups banned"

You just used the wrong slash to escape the apostrophe.
Line 92, to 108

Find:
    $setting2 = array(
        "sid"           => NULL,
        "name"          => "threadrestriction_bangroups",
        "title"         => "Usergroups Banned",
        "description"   => "Enter the id/'s of usergroups banned",
        "optionscode"   => "text",
        "value"         => " ",
        "disporder"     => 2,
        "gid"           => $gid
    );
 
    $db->insert_query("settings", $setting2);
     
    rebuild_settings();  
                                       
 
}

Replace it with:

    $setting2 = array(
        "sid"           => NULL,
        "name"          => "threadrestriction_bangroups",
        "title"         => "Usergroups Banned",
        "description"   => "Enter the id\'s of usergroups banned",
        "optionscode"   => "text",
        "value"         => " ",
        "disporder"     => 2,
        "gid"           => $gid
    );
 
    $db->insert_query("settings", $setting2);
     
    rebuild_settings();  
                                       
 
}
Thanks, now correctly all Smile

Thanks , updated yet , I hope you can help me also in trouble just codding

Yes, because to ALL users NO thread is visible , an error message appears , I would just like to specific threads to specific users / groups ( in the settings of the plugin , there is in fact to put the various tid , uid and gid related )

You can understand it entering my forum http://yugiohspirits.altervista.org/ is go to any thread ..

How do I get what I want ?

Link again to the plugin > https://www.dropbox.com/s/fxd6ep6ga97n1v...n.php?dl=0

End plugin Smile

Anyway, thanks

Plugin is relesed > http://community.mybb.com/mods.php?action=view&pid=317