Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
prefs_id field in Txp database
Does it serve any purpose? It’s part of the txp_prefs table’s UNIQUE KEY, but it seems to always be set to “1”. Just wondering if I can ignore it and let it default to “0”.
Code is topiary
Offline
Re: prefs_id field in Txp database
Use common sense. If it’s set to 1 everywhere, don’t set it to 0 yourself ;)
Offline
Re: prefs_id field in Txp database
fwiw, I have no idea what it’s for. I do know that I consistently used to assume it was some kind of auto-increment ID and forgot to inlcude it in my SQL statements only to be told off! I never learned, for some reason…
Lucikly, set_pref()
and get_pref()
save the day now: I use those functions almost exclusively as it does all the drudgery for me, as well as allowing per-user prefs to be created/read in a uniform manner.
Last edited by Bloke (2009-09-02 16:48:56)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: prefs_id field in Txp database
ruud wrote:
Use common sense. If it’s set to 1 everywhere, don’t set it to 0 yourself ;)
Common sense? Is that a Txp function?
Bloke wrote:
set_pref()
andget_pref()
save the day now: I use those functions almost exclusively as it does all the drudgery for me, as well as allowing per-user prefs to be created/read in a uniform manner.
Ta!
Code is topiary
Offline
#5 2011-01-09 20:48:47
- Themroc
- Plugin Author
- From: Germany
- Registered: 2011-01-02
- Posts: 23
Re: prefs_id field in Txp database
After a 10-minute-investigation, i’d say:
If u want prefs_list(), advanced_prefs() and get_prefs() to not see your data, set prefs_id to anything but 1.
Thus, it seems pretty useless…
History teaches us that history teaches us nothing. — Voltaire
Offline
#6 2011-01-14 15:15:58
- Themroc
- Plugin Author
- From: Germany
- Registered: 2011-01-02
- Posts: 23
Re: prefs_id field in Txp database
Sry, that last sentence was totally wrong. Setting prefs_id != 1 seems to be the only way to not pollute the global namespace with all the stuff from txp_prefs.
History teaches us that history teaches us nothing. — Voltaire
Offline
Pages: 1