【问题标题】:i have 3 tables which have many to many relationship with each other,now how to fetch data using mysql in laravel我有 3 个表,它们之间有多对多的关系,现在如何在 laravel 中使用 mysql 获取数据
【发布时间】:2019-06-05 14:07:04
【问题描述】:

有学生表,有 id,姓名,地址,有测试表,有 id,test_type.students 和测试表有很多对多的关系。所以有数据透视表 student_test 和 student_id,test_id 属性。并且有第三个表subjects id,sub_name.tests 和subjects 也有多对多的关系。所以有一个带有test_id,subject_id 属性的数据透视表subject_test。现在我想获取学生的 test_type 和 sub_name。

【问题讨论】:

    标签: mysql laravel


    【解决方案1】:

    您的问题看起来很乱,请尝试使用可用的格式工具重新表述您的问题,并为studentsstudent_test 等分享您的表格结构 .否则,没有人会花时间猜测您的数据库架构是如何组织的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-06-21
      • 1970-01-01
      • 2021-07-22
      • 2019-01-06
      • 2019-09-16
      • 1970-01-01
      • 1970-01-01
      • 2020-10-11
      相关资源
      最近更新 更多