dongxiao1591 2014-05-14 23:29
浏览 32
已采纳

多语言网站的数据库结构[重复]

This question already has an answer here:

I have this simple database driven website and it has tables such as this,

article table,

id   title   url       content
1    Hello   hello     bla bla bla

this table keeps the English version's data only.

but now I need to create a French version for my website, what should I do with my tables for storing French version's data?

Do I have to duplicate the tables such as article table for storing French data?

Any suggestions in handling database for making a multi-languages website?

</div>
  • 写回答

1条回答 默认 最新

  • doushan1863 2014-05-15 01:05
    关注

    My suggestion is create a table for languages. In this table you will add many languages. In the table article you will add a id for a language and of course you will duplicate all data in this table with the French values.

    Be careful to not miss any information. It means if you have values just in En and you entry into the site in Fr you will get a exception.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Opencv(C++)异常
  • ¥15 VScode上配置C语言环境
  • ¥15 汇编语言没有主程序吗?
  • ¥15 这个函数为什么会爆内存
  • ¥15 无法装系统,grub成了顽固拦路虎
  • ¥15 springboot aop 应用启动异常
  • ¥15 matlab有关债券凸性久期的代码
  • ¥15 lvgl v8.2定时器提前到来
  • ¥15 qtcp 发送数据时偶尔会遇到发送数据失败?用的MSVC编译器(标签-qt|关键词-tcp)
  • ¥15 cam_lidar_calibration报错