當(dāng)我注意到我的一個模組給我這個錯誤時,我將要打開我的網(wǎng)站:致命錯誤:無法在第303行的/var/www/vbsubscribetouser.php中將mysqli_result類型的對象用作數(shù)組我去了303行,這就是我發(fā)現(xiàn)的內(nèi)容://Check if requested username can be followed.if (in_array($followingdata['usergroupid'], explode("|", $vbulletin->options['subscribetouser_usergroups_cannot']))){這是從第303行開始的所有代碼://Check if requested username can be followed.if (in_array($followingdata['usergroupid'], explode("|", $vbulletin->options['subscribetouser_usergroups_cannot']))){ exit;}if ($followinginfo[subscribers] > 0){ $user_followers = $followinginfo[followers].$userinfo[userid].'|';}else{ $user_followers = '|'.$userinfo[userid].'|';}$vbulletin->db->query_write(" UPDATE " . TABLE_PREFIX . "user SET subscribers = subscribers + 1, `followers` = '$user_followers' WHERE userid = $followinginfo[userid]");我不是php編碼方面的專家,因此在打開網(wǎng)站之前會有所幫助。任何幫助/建議嗎?非常感謝你!
1 回答

哆啦的時光機(jī)
TA貢獻(xiàn)1779條經(jīng)驗 獲得超6個贊
無法將類型為mysqli_result的對象用作數(shù)組
使用mysqli_fetch_assoc或mysqli_fetch_array提取結(jié)果行作為關(guān)聯(lián)數(shù)組。
$query = "SELECT 1";
$result = $mysqli->query($query);
$followingdata = $result->fetch_assoc()
要么
$followingdata = $result->fetch_array(MYSQLI_ASSOC);
添加回答
舉報
0/150
提交
取消