我有一个带有两个集合的数据库。学生收藏有一个名为“student_bookselections”的字段,用于保存书籍的 ID。此字段的内容经常会更改或更新。
- 我们如何向 student_bookselections 添加或删除 id?
- 这是关联收藏的一种不错的方式吗?
学生收藏
array(
"student_id" => 4,
"student_fullname" => $studentfullname,
"student_bookselections" => 'id1, id34, id788 ... ... id4'
)
书籍收藏
array(
"book_id" => 4354,
"book_title" => $title,
"book_author" => $author,
)