douxi7219 2014-01-14 17:53
浏览 146

在数据库中存储HTML表的数据

I'm developing an application using PHP / SQL Server that needs to store information on graduates from tons of different academic programs, along with information on how many were employed after graduating... This will then be queried by users, who will want to compare one program to another, so they will need to be able to generate custom tables showing the outcomes for students. Tables will be something like this:

Program            Salary after 1 Year      Salary after 2 Years         Etc...
Engineering        Lots                     Even more!
Philosophy         Nothing                  Are you kidding me?

So, here's the question: should I store individual values for these data points in the database, or should I just store the raw HTML for the table row?

In other words, do I store this:

ProgramID    Salary1    Salary2               Etc...
1            Lots       Even More!
2            Nothing    Are you kidding me?

Or do I store this:

ProgramID   RowHTML
1           <td>Lots</td><td>Even More!</td>...
2           <td>Nothing</td><td>Are you kidding me?</td>

I can see arguments for both approaches... my gut tells me that storing the raw HTML will be faster - it will eliminate GOBS of PHP processing. But I'm open to other interpretations.

  • 写回答

5条回答 默认 最新

  • dongxianchu3541 2014-01-14 17:58
    关注

    I would store the raw data only. this will provide the ability to change the format/layout of the page when your boss says "Make it look newer" or whatever. If you store the table data, you are stuck.

    评论

报告相同问题?

悬赏问题

  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c