Hi Sitepointer,

I have written a website template system for multilingual websites. It's fairly simple.

There are 3 database tables, placeholder, placeholder_language and language (see structure below).

In my template I replace a word in squared brackets [example] with what ever that word is in the users selected language.

using str_replace I replace the bracketed word [example] for 'example' if the user is viewing the site in English and 'ejemplo' if the user is viewing the site in Spanish.

The placeholders are parsed is done on every page load. My worry is that this will cause excessive load with multiple users.

Since these variables don't change is there a way of holding them in RAM or making them available as variables to the application as a whole?

Many thanks. Muchas Gracias.

Tables follow.

CREATE TABLE IF NOT EXISTS `placeholder` (
`placeholder_id` int(11) NOT NULL AUTO_INCREMENT,
`placeholder_name` varchar(255) NOT NULL,
PRIMARY KEY (`placeholder_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0;


CREATE TABLE IF NOT EXISTS `placeholder_language` (
`placeholder_language_id` int(11) NOT NULL AUTO_INCREMENT,
`placeholder_id` int(11) NOT NULL,
`language_id` int(11) NOT NULL,
`placeholder_language_name` varchar(255) CHARACTER SET utf8 NOT NULL,
PRIMARY KEY (`placeholder_language_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;

CREATE TABLE IF NOT EXISTS `language` (
`language_id` int(11) NOT NULL AUTO_INCREMENT,
`language_name` varchar(255) NOT NULL
PRIMARY KEY (`language_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;