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

  • SEARCH
  • Home
  • 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 8166571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:55:08+00:00 2026-06-06T19:55:08+00:00

I am creating a script where I need to retrieve several information in a

  • 0

I am creating a script where I need to retrieve several information in a database. I am expecting to receive these datas

enter image description here

I need to get those 2 track paths. but all I get is the first result and that’s it.
I’ve run my SQL script in phpmyadmin it is completely showing all of the datas that I needed. but when I execute that query in PHP. it only returns to me the first result.
Here’s my script

public static function find_user_tracks($id){
    global $mySQL;
    $sql = "SELECT * FROM `tracks` WHERE account_id = {$id}";
    $result_set =  $mySQL->query($sql);
    return $result_set->fetch_assoc();
} 

And here’s the code I call to print the results

$row = Track::find_user_tracks($id);
                echo "{$row['track_path']}<br>";    

but all I receive is only the first path.

  • 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-06T19:55:10+00:00Added an answer on June 6, 2026 at 7:55 pm

    You need to do a loop to return all records.

    public static function find_user_tracks($id){
        global $mySQL;
        $sql = "SELECT * FROM `tracks` WHERE account_id = {$id}";
        $result_set =  $mySQL->query($sql);
        $ret = array();
        while($row = $result_set->fetch_assoc()) {
          $ret[] = $row;
        }
        return $ret;
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a pagination script and I need to get the first and
I have simple table creating script in Postgres 9.1. I need it to create
I'm creating a script for users to run. I need to redirect the output
I'm creating script for automated testing of financial application. Using VbScript as language. Need
I need some assistance in creating a shell script to run a specific command
I am creating a php script to post some information on a fan page
I am creating a script which need to parse the yaml output that the
I am creating a script that will show your computer information in Non-Geekeese. This
I'm creating an installation script for an application that I'm developing and need to
I keep running into several issues when creating a countdown script it does not

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.