in reply to [OT] Database Design
CREATE TABLE `languages` ( `lang_id` TINYINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, `lang_name` VARCHAR(60) NOT NULL ); CREATE TABLE `post_translations` ( `post_translation_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT PRI +MARY KEY, `post_translation_cat` INT(11) UNSIGNED NOT NULL, `post_translation_date` DATETIME NOT NULL, `post_translation_title` VARCHAR(255) NOT NULL, `post_translation_body` TEXT NOT NULL, `post_translation_lang` TINYINT UNSIGNED NOT NULL ); CREATE TABLE `posts` ( `post_id`, INT(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, `post_translation_id` INT(11) UNSIGNED NOT NULL, );
For each post, you'll have multiple translations. All you have to do now is to find the correct translation for the current post_id.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: [OT] Database Design
by Anonymous Monk on Aug 11, 2010 at 02:58 UTC | |
by ikegami (Patriarch) on Aug 11, 2010 at 03:16 UTC | |
|
Re^2: [OT] Database Design
by xiaoyafeng (Deacon) on Aug 11, 2010 at 09:50 UTC |