此代码仅返回一行,但应返回 2 行。我已经在 phpMyAdmin 中尝试过 SQL,它完美地返回了 2 行。我在这里做错了什么?
$request_list_result = $mysqli->query("
SELECT buddy_requester_id, buddy_reciepient_id, user_id, user_fullname FROM sb_buddies
JOIN sb_users ON buddy_requester_id=user_id
WHERE buddy_status='0' AND buddy_reciepient_id='". get_uid() ."'");
$request_list_row = $request_list_result->fetch_array();
echo $request_list['user_fullname'];
顺便说一句,上面的代码是通过以下脚本获取 profile.php 的过程:
$index = new Template('views/template/one.php', array(
'subtitle' => 'Dashboard',
'stylesheets' => array('/assets/css/profile.css'),
'scripts' => array('/assets/js/dashboard.js'),
'sidebar' => 'sidebar.php',
'content' => 'views/profile.php',
'errors' => $errors,
'successes' => $successes,
'request_list' => $request_list_row //right here
), true);