Hasti Posted June 29, 2009 Share Posted June 29, 2009 Hello Everyone I want to make global array at application level without using session. Once the application execution begins first time data comes from database and stored in array then next everytime data should be loaded from array instead of database. Thanks in advance Regard Hastimal Shah Link to comment https://forums.phpfreaks.com/topic/164051-solved-global-array-at-application-level/ Share on other sites More sharing options...
tomdchi Posted June 29, 2009 Share Posted June 29, 2009 If not storing in the session then where do you plan to store the data from the array after the first access from the db? It has to go somewhere. I guess if you really wanted to you could maybe store it with a cookie but thats probably a bad idea for security reasons. Link to comment https://forums.phpfreaks.com/topic/164051-solved-global-array-at-application-level/#findComment-865421 Share on other sites More sharing options...
JasonLewis Posted June 29, 2009 Share Posted June 29, 2009 Yeah you kind of need to use sessions for something like this. The way I see it, it's either sessions or call it from the database every page load. One question, why don't you want to use sessions? Link to comment https://forums.phpfreaks.com/topic/164051-solved-global-array-at-application-level/#findComment-865432 Share on other sites More sharing options...
Hasti Posted June 29, 2009 Author Share Posted June 29, 2009 Hello Am using CI framework. And my array is so big. And even session has limit to store it. that why am searching for other solution. Link to comment https://forums.phpfreaks.com/topic/164051-solved-global-array-at-application-level/#findComment-865433 Share on other sites More sharing options...
tomdchi Posted June 29, 2009 Share Posted June 29, 2009 can you store in a temp text file or a temp db table. MySQL has Memory table type that can be used for such purposes. Link to comment https://forums.phpfreaks.com/topic/164051-solved-global-array-at-application-level/#findComment-865456 Share on other sites More sharing options...
corbin Posted June 29, 2009 Share Posted June 29, 2009 Uhmmm.... If the array is too big to fit in a session, what in the world is the data? Do you use all of the data each page load? By the way, HTTP is stateless, so unless you use cookies (which have an 8kB or something limit), sessions are your only option. Edit: Hrmm... Well, actually you could probably get around using sessions.... For example, you could use something like memcached. But that would essentially be sessions. Link to comment https://forums.phpfreaks.com/topic/164051-solved-global-array-at-application-level/#findComment-865462 Share on other sites More sharing options...
Hasti Posted June 29, 2009 Author Share Posted June 29, 2009 Hello Thanks everyone for your valuable suggestion. Finally i used session for this problems. Regards Hastimal Shah Link to comment https://forums.phpfreaks.com/topic/164051-solved-global-array-at-application-level/#findComment-865537 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.