Settings.
Settings.
Hi, I have a table for settings. I only want to be able to add one row to this table as its for settings only. So don't want to be able to ADD NEW to that. what would be the best way to achieve this? Thanks. Mark
Best Wishes,
Mark
Mark
Re: Settings.
Maybe you should try something like this:
Code: Select all
function settings_init(&$options, $memberInfo, &$args)
{
$options->AllowInsert = sqlValue("SELECT count(*) FROM settings") == 0 ? 1 : 0;
return TRUE;
}
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: Settings.
Thats great. Is that a shorthand for the select? An if then ? - I like it. Thanks for this.
Best Wishes,
Mark
Mark
Re: Settings.
Thanks mqley for asking about this and thanks Jan for the answer.
Actually I was looking for this solution as well.
And mqley, regarding your question about the shorthand, I found this
https://www.php.net/manual/en/language. ... arison.php
Scroll down to the "Ternary Operator " area. Hope this help.
Actually I was looking for this solution as well.
And mqley, regarding your question about the shorthand, I found this
https://www.php.net/manual/en/language. ... arison.php
Scroll down to the "Ternary Operator " area. Hope this help.
Zala.
Appgini 24.10.1579, MacOS 14.3.1 Windows 11 on Parallels.
Appgini 24.10.1579, MacOS 14.3.1 Windows 11 on Parallels.