gpt4 book ai didi

php - 在一个id中保存一个变量的多于1个数据

转载 作者:行者123 更新时间:2023-11-29 08:45:22 26 4
gpt4 key购买 nike

我抓取了一个网络,例如我抓取了作者($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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com