Speeding up database access
| From: | (Rob\[UK\]) | Date: | Fri, 05 Oct 2001 09:35:37 +0000 |
| Subject: | Speeding up database access | ||
| Groups: | php.db php.db | ||
| Request: | Send a blank email to php-db+get-13030@lists.php.net to get a copy of this message | ||
I am just starting out on a project that has to be multi-lingual. i.e.
every word/sentence I output has to be translated.
The user logs in, and I read the language they use, by looking at the
user record.
I then need to get the language translations from a database.
I just "select label, text from language where lang = "English";
Fields: [label],[text],[language]
Example: "M1002","Please enter the delivery address","English"
At the moment I download them into a associative array, so I can
access the text like this.
txt['M1002']
where 'M1002' is a label. I have made txt a session variable.
The trouble is, there are so many text translations (6000+), that it
takes about 10 seconds to download them all into this array.
I don't want to access the database every time I need to print out
some text.
Question:-
How can I improve the startup time?? In case it was not obvious from
the above, I am a newbie at PHP!!