CodeIgniter Forums
Can I run mysql query in constant.php file to make constant dynamic - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: External Resources (https://forum.codeigniter.com/forumdisplay.php?fid=7)
+--- Forum: Addins (https://forum.codeigniter.com/forumdisplay.php?fid=13)
+--- Thread: Can I run mysql query in constant.php file to make constant dynamic (/showthread.php?tid=67118)



Can I run mysql query in constant.php file to make constant dynamic - shaheb - 01-17-2017

question could be funky, can I run mysql query into application/config/constant.php file to make constant dynamic or any proper way to make constant dynamic based on value coming from db.


RE: Can I run mysql query in constant.php file to make constant dynamic - php_rocs - 01-18-2017

@shaheb

https://www.codeigniter.com/user_guide/libraries/config.html?highlight=setting%20config%20item

Look for the topic "Setting a Config Item"


RE: Can I run mysql query in constant.php file to make constant dynamic - enlivenapp - 01-18-2017

I just did something similar in routes for Open Blog.

Feel free to look/borrow code/try it out.

https://github.com/enlivenapp/Open-Blog-3/commit/8ae68ceb099a763dcafe1c8f22c7a1209b394961