Page 1 of 1

i need an simple example of multi languages

Posted: Mon Sep 28, 2009 2:27 pm
by egturnkey
Hello Friends,

i need an simple example explain to me how this could be.

- a database table has 2 lang ( english - french ) where english is the dafult

- an php file that has input where it can shown the text with abilities to update it

explain more
------------

1- database where i can store the english language and french language.

2- config.php // connect to the database.

3- index.php file that shown the varibles language in english which select form where i can switch off btween english/french. and it shown it in a input with abilites to update the text language

:oops: can anyone help me even with a very very primtive example cause i really needs to understand it and example is the only way that helps me to understood the whole idea.


thanks in advance

Re: i need an simple example of multi languages

Posted: Mon Sep 28, 2009 5:33 pm
by Jade
I'm not totally sure what you're asking for but I'll give it a go.

On the index page you'll need to create a drop down box where they can select a language. Depending on the language they select set a session variable for that language.

Every time you load a page you'll need to check the value of that session variable. Then select the appropriate text where language=$_SESSION['language'];

Here's some other stuff you'll want to read:

Setting up a mySQL Database: http://dev.mysql.com/doc/refman/5.1/en/ ... e-use.html
Connecting to a database: http://www.php.net/function.mysql-connect
Sessions: http://www.php.net/manual/en/book.session.php
SQL Select Query: http://dev.mysql.com/doc/refman/5.0/en/select.html