我在MySQL中都有两个表
Forwards_signs
+----+-------------+----------+
+ ID + Forward_id + sign_id +
+----+-------------+----------+
+ 4 + 2 + 2 +
+ 5 + 2 + 3 +
+ 4 + 2 + 14 +
+----+-------------+----------+
标志表
+----+-------------+---------------------------------+
+ ID + Signno + Gejala +
+----+-------------+---------------------------------+
+ 2 + SIG002 + Bulu rontok berlebihan +
+ 3 + SIG003 + Terdapat kebotakan +
+ 14 + SIG004 + Bercak putih seperti ketombe +
+ 8 + SIG008 + Terdapat kerak keropeng +
+ 9 + SIG009 + Warna bulu pucat dan kotor +
+----+-------------+---------------------------------+
我在表方法中使用了具有关系hasMany()的CakePHP框架。 我要加入并匹配两个表的目标,外键将匹配主键,
我想像不到的结果
Forwards_signs table Signs table
+----+-----------------+------+----------+---------------------------------+
+ ID + sign_id + ID + Signno + Gejala +
+----+-----------------+------+----------+---------------------------------+
+ 4 + 2 + 2 + SIG002 + Bulu rontok berlebihan +
+ 5 + 3 + 3 + SIG003 + Terdapat kebotakan +
+ 4 + 14 + 14 + SIG014 + Bercak putih seperti ketombe +
+----+-----------------+------+----------+---------------------------------+
感谢大家,希望为我带来麻烦。.