MyBB Community Forums

Full Version: Help with SQL statments
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I want to use a global variable in MyBB system and so to do that I', thinking of useing the SQL database the system uses. I created a table named 'myhebbb_generalsiteoperations' (the 'myhebbb_' is my/the TABLE_PREFIX) with one field named 'dateformat' (its set as an INT with default of zero(0)). My knowledge of SQL is very limited. Please tell me whats the line/statement to set the field to either one(1) or zero(0) and the one to check its value.

Thanks a lot,
Ori...
MyBB already has such a system, it's called $settings and used by every plugins to set their variables (configuration options). Can't you just use that instead of inventing your own?
OK. I guess I can. What then do I write to set a value and to check/get the value of the $settings.

Edit: I created a line in the $settins table [sid=9999 (so no future plugin will ever get to this no.), name=spcialdateformat, title/description=(some text), optionscode=yesno, value=0, disporder=1, gid=9999 (none existent, so same as 'sid'), isdefault=1 .


Ori...