Logo Logo
Back to list
WEB

How to Properly Design a Database for Multi-language Websites

20. 03. 2026
How to Properly Design a Database for Multi-language Websites

When creating a multi-language website, we often wonder if we need a separate table for each language. The answer is a firm NO.

Why use only one table?

Using a single table brings key advantages, as shown below:

Advantage Description
Data Integrity You change data in only one place.
Easy Maintenance The same SQL query works for all languages.

Practical Example: "stranke" Table

Below is the SQL code to create a universal table:


CREATE TABLE IF NOT EXISTS stranke (
id INT AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NULL,
address VARCHAR(100),
house_number VARCHAR(10),
city VARCHAR(50),
zip_code VARCHAR(10)
);

In PHP code, we simply change the table headers (e.g., "Ime" in Slovenian and "First Name" in English), while the data remains the same.

Hvala za obisk! Dodajam politiko zasebnosti.

© 2024 Vse pravice pridržane.

Vam je koda pomagala? Če želite podpreti moj trud pri pripravi vodičev in vzdrževanju strani, mi lahko namenite donacijo za kavo.