作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我抓取了一个网络,例如我抓取了作者($author
)和作者的链接。对于一个id,有时有2个作者,当我将他们保存到数据库中时,他们会被分隔在不同的id中,
例如:我得到 $author
和 $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 |
===========================================================
是否可以将它们保存在同一个 id 中?如何?先感谢您 :)仅供引用,我想将它们保存在一个 id 中,因为下一个过程是我想将该表与具有相同 web
的其他表进行内部连接。如果同一个web
中有两个id,它们将被打印两次。
最佳答案
没有。创建另一个实际包含作者和 id 的 fkey 的表,以便将数据库保留在 first normal form 中。 .
关于php - 在一个id中保存一个变量的多于1个数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12655953/
我是一名优秀的程序员,十分优秀!