Re: Which is faster, a MySQL access, or a set of PHP variables?
| From: | Miles Thompson | Date: | Fri, 30 Dec 2005 15:16:33 +0000 |
| Subject: | Re: Which is faster, a MySQL access, or a set of PHP variables? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-228017@lists.php.net to get a copy of this message | ||
At 10:32 AM 12/30/2005, Dave M G wrote:
PHP General,Dave, I did that for an online auction site, now defunct, where the languages could be German or English. To expand to Spanish one had only to supply the structure and have someone who knew one of the other languages to enter the correct terms. That would be pasted into the script and run, presto, the site was available in Spanish. Database hits ere not a problem, as all of the content on the page came from a database, none of the content was static. That was three years ago, and it was done that way because native language support was "wobbly" in both PHP and Apache. Joachem's solution is probably better for today. Cheers - Miles Thompson -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.1.371 / Virus Database: 267.14.9/216 - Release Date: 12/29/2005I have a site where I will set the interface up to be multilingual.This means that all the snippets of text which make up the menu and other elements of navigation common to most pages will be stored as variables.In most web site set ups that I have seen, especially on forums, thetext is stored in a PHP script which is just a long list of variables.I wondered if there was any downside to storing the list of interfacetexts in a MySQL database, then calling them as an array when the page loads?This would have one minor advantage, which is that as I expand to newlanguages, I could build a simple web interface where people could input new languages into a form.However, is it a drag on a server to have to reach into the MySQLdatabase to retrieve the array of texts each time the page loads? Note that the texts will be something like 20 to 30 small one to four word phrases like "contact" and "previous page" and that sort of thing.On the surface, it doesn't seem like this would be much different thanaccessing a PHP script with a list of variables. But then, I figured there might be a reason why I've never seen it done this way.Opinions would be much appreciated.-- Dave M G