dswsl2016 2012-09-29 19:52
浏览 10
已采纳

在一个id中保存一个变量的1个以上数据

I crawled a web, for example I crawled to get the authors ($author) and the link of authors. For one id, sometime, there are 2 authors, and when I save them in database, they will be separated in different id,

for example : I get $author and $link = string(14) "Aaron M. Cohen" string(73) "http://example.com/Author/4279758" string(16) "William R. Hersh" string(68) "http://example.com/Author/299122"

===========================================================
|id|web|      author    |            author_link          |
===========================================================
|1 | A |Aaron M. Cohen  |http://example.com/Author/4279758|
|2 | A |William R. Hersh|http://example.com/Author/299122 |
===========================================================

Is it possible to save them in one same id? How? thank you in advance :) fyi, I wanna save them in one id, because of the next process is I want to inner join the table with other table that have same web. If there are two id in same web, they will be printed twice.

  • 写回答

1条回答 默认 最新

  • doutang7414 2012-09-29 19:56
    关注

    No. Create another table that actually contains the author and a fkey to the id in order to keep the database in first normal form.

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

报告相同问题?

悬赏问题

  • ¥15 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
  • ¥20 关于URL获取的参数,无法执行二选一查询
  • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
  • ¥15 marlin编译错误,如何解决?
  • ¥15 有偿四位数,节约算法和扫描算法
  • ¥15 VUE项目怎么运行,系统打不开
  • ¥50 pointpillars等目标检测算法怎么融合注意力机制
  • ¥20 Vs code Mac系统 PHP Debug调试环境配置
  • ¥60 大一项目课,微信小程序
  • ¥15 求视频摘要youtube和ovp数据集