我对我的表使用了自联接,但我无法检索表行
$SQL1 = "SELECT e1.userid, e2.userid
FROM userfield AS e1, userfield AS e2
WHERE e1.field5 = e2.field5 and e1.field5!=' ' and e2.field5!=' ' and e1.userid!=e2.userid";
$result2 = mysql_query($SQL1);
while ($db_field2 = mysql_fetch_assoc($result2)) {
print $dbfield2[userid];
}
当我执行此代码时,它只显示空白页。当我在 msql 数据库中触发此查询时,它返回两个用户 ID
任何帮助将不胜感激