我在这里的问题(可能)是 $db->fetch_array 不会显示数据库中的所有结果。我不知道会发生什么,但我只得到了 3 个结果中的 1 个,即使我稍微更改了查询,我也尝试了很多东西。你有什么想法为什么我不能在这里得到所有的结果吗?
它适用于 vBulletin 3.8 顺便说一句。
谢谢人们。
if ($_REQUEST['do'] == 'showthis') {
$rel = $db->query_first("
SELECT *
FROM " . TABLE_PREFIX . "anexampletable
WHERE fromuserid OR touserid = " . $vbulletin->userinfo['userid'] . "
AND confirmstatus =1
");
if ($rel) {
$queryrel = $db->query_read("
SELECT *
FROM " . TABLE_PREFIX . "anexampletable
WHERE fromuserid OR touserid = " . $vbulletin->userinfo['userid'] . "
AND confirmstatus =1
");
while ($queryre = $db->fetch_array($queryrel)) {
if ($queryre['reltype'] == '1') {
$ty = " is something else ";
} else if ($queryre['reltype'] == '2') {
$ty = " is something ";
} else if ($queryre['reltype'] == '3') {
$ty = " is something else ";
} else if ($queryre['reltype'] == '4') {
$ty = " is something ";
} else if ($queryre['reltype'] == '5') {
$ty = " is something ";
} else if ($queryre['reltype'] == '6') {
$ty = " is something ";
} else if ($queryre['reltype'] == '7') {
$ty = " is something ";
} else if ($queryre['reltype'] == '8') {
$ty = " is something ";
} else if ($queryre['reltype'] == '9') {
$ty = " is something ";
} else if ($queryre['reltype'] == '10') {
$ty = " is something ";
} else if ($queryre['reltype'] == '11') {
$ty = " is something else ";
} else if ($queryre['reltype'] == '12') {
$ty = " is something else ";
} else if ($queryre['reltype'] == '13') {
$ty = " is something ";
} else if ($queryre['reltype'] == '14') {
$ty = " is something ";
} else {
$ty = " is default ";
}
$sender = $queryre['fromusername'];
$receiver = $queryre['tousername'];
$showit = $sender . $ty . $receiver;
}
eval('print_output("' . fetch_template('relationships') . '");');
}
}