$sql = "SELECT MEM.[i], MEB.[/i] FROM " . $this->get_table('users') . " AS MEM LEFT JOIN " . $this->get_table('users_attrib') . " AS MEB ON MEM.uid = MEB.uid WHERE MEM.uid = " . intval($uid);这条语句似乎有问题,它查询的结果中有两个 'uid' 字段(同名),前一个正常,后一个值为 NULL。这导致了最后显示的用户信息中 uid=NULL。 PS: 我把语句改成
$sql = "SELECT MEM.*, MEB.id, MEB.introduction, MEB.signature, MEB.qq, MEB.homepage FROM " . $this->get_table('users') . " AS MEM LEFT JOIN " . $this->get_table('users_attrib') . " AS MEB ON MEM.uid = MEB.uid WHERE MEM.uid = " . intval($uid);可以正常使用了。
这家伙很懒,还没有设置简介