PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, February 8, 2022

[FIXED] How to load constants dynamically in Codeigniter?

 February 08, 2022     codeigniter, codeigniter-3, php     No comments   

Issue

I have a table alertTypes. On a callback I need to access this table data.Every hour, website receives more than 1k hits from these callbacks. This makes a lot of db queries which I want to reduce. How can be these alertTypes records made global in constants.php?


Solution

I have found the answer for this. What I did, I created a pre controller (a type of HOOKS in codeigniter ) which loads all the data needed for the processing. It reduces db queries significantly.



Answered By - aarunbhardwaj
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing