Re: application-wide shared data/object
| From: | Aaron Greenspan | Date: | Thu, 28 Jul 2005 01:46:55 +0000 |
| Subject: | Re: application-wide shared data/object | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-219462@lists.php.net to get a copy of this message | ||
Hi,
Not sure if everyone would agree, but I think the best way to go about doing this is just to make a table in a relational database. You can restrict access permissions using MySQL if that's something you're really concerned about, but there's basically no disadvantage to just storing your data in a MyISAM table instead of a shared object. You can index, sort, etc. very quickly that way. You can even load the result of the query into your $_SESSION variable after the first time so that you essentially have the result set cached. If indexing isn't a big deal, I'd just say store the data in a flat file. You can always move it outside of the web-accessible directory if you're worried about people accessing it directly.
Alternately, you could just store the data in a PHP file and include it in your scripts. Either way works, I think.
Aaron
Aaron Greenspan
President & CEO
Think Computer Corporation
http://www.thinkcomputer.com