Storing const vars

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
mojeIme
Forum Newbie
Posts: 22
Joined: Sat Jul 29, 2006 8:58 am

Storing const vars

Post by mojeIme »

I am thinking about storing some constant variables into mysql db ,so i can easy retrive or change them whenever i need (tblSettings). Is it posible, pointless, or there is another better way to menage this?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

They can't really be "constant" if you plan on changing them. Storing settings in a database is fine yes... in fact many people do it :)
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Well, in terms of being constant in one script execution...

I agree. Database can be okay. If you're concerned about performance, you can always retrieve all the rows and serialize them in order to avoid a database call.
Post Reply