Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8936853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:18:22+00:00 2026-06-15T10:18:22+00:00

This code only returns one row, but it should return 2 rows. I have

  • 0

This code only returns one row, but it should return 2 rows. I have tried the SQL in phpMyAdmin and it perfectly returned 2 rows. What am I doing wrong here?

$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'];

By the way, the code above is getting process to profile.php via following script:

$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);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:18:22+00:00Added an answer on June 15, 2026 at 10:18 am

    You need to loop through the results (as TheSmose mentioned)

    while ($request_list_row = $request_list_result->fetch_array()) {
        echo $request_list['user_fullname'];
    }
    

    AND you need to send the resulting array $request_list to the template rather than $request_list_row.

    Change this

    'request_list' => $request_list_row //right here
    

    to this

    'request_list' => $request_list //right here
    

    If you want more than just user_fullname in your template (and you don’t have PHP >= 5.3 required for mysqli_result::fetch_all), then you will need to build up your own array inside the loop.

    I don’t know what your template code expects, but you could try

    while ($request_list_row = $request_list_result->fetch_array()) {
        echo $request_list[] = $request_list_row;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use this code to return many rows as one row in SQL Server
someone kindly posted this code for me but it only returns /table in the
This code is only updating one row (the one that matches the first in
I have a function which returns only one row as array. I give a
function urllinks(str){ return str.replace(/\b((http|https):\/\/\S+)/g,'<a href=$1 target=_blank>$1</a>'); } This code is replacing only http and
How could I refactor this code to use only one Dir[ ] call? Dir[
i am creating a table and uinserting the row in it like this.only one
This code only renders a dodecahedron and completely ignores the glBegin(GL_TRIANGLES) block: glutSolidDodecahedron(); glBegin(GL_TRIANGLES);
Why does this code only draw a circle once? I cannot for the life
How to make this css code cross browser compatible using jquery. this code only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.