【发布时间】:2015-01-20 21:21:17
【问题描述】:
我正在使用 Laravel 4.2 开发一个网站。我有两个表格:articles 和 tags。
这是我的标签表:
id | article_ids | xxxx
2 | 2,41,23,6 | xxxx
我正在使用 Eloquent,我想在 article_ids 列中找到一个特定的 id。 我怎样才能做到这一点?
我可以这样在 MySQL 中搜索吗?
感谢您的帮助。对不起我的英语不好。
【问题讨论】:
-
糟糕的表格设计,每个 article_id 一个 id 的表格很有意义
-
是的,但我想为其他项目学习这个。这对我很重要。
标签: php mysql sql laravel eloquent