对于我的一生,我无法弄清楚哪里出了问题
我正在从这些多个表中提取数据,但是没有数据出现
$result=mysql_query("SELECT * FROM chars uc
INNER JOIN zone_settings t ON uc.pos_zone = t.zoneid
INNER JOIN char_look v ON uc.charid = v.charid
INNER JOIN char_jobs y ON uc.charid = y.charid
INNER JOIN char_stats n ON uc.charid = n.charid
INNER JOIN char_profile p ON uc.charid = p.charid
WHERE `accid`='".$user["id"]."' ORDER BY `charid`");
感谢kwolfe使用LEFT JOIN和Remove ORDER BY现在可以工作了。这是代码。
$result=mysql_query("SELECT * FROM chars uc
LEFT JOIN zone_settings t ON uc.pos_zone = t.zoneid
LEFT JOIN char_look v ON uc.charid = v.charid
LEFT JOIN char_jobs y ON uc.charid = y.charid
LEFT JOIN char_stats n ON uc.charid = n.charid
LEFT JOIN char_profile p ON uc.charid = p.charid
WHERE `accid`='".$user["id"]."'");
最佳答案
切换到LEFT JOINS来查看您是否在此过程中缺少关系(INNER JOIN将仅显示为每个表建立关系的数据,在这种情况下为所有表。)