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 1007131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:34:15+00:00 2026-05-16T08:34:15+00:00

Hey guys, first time using stackoverflow. can you guys help me debug? Heres the

  • 0

Hey guys, first time using stackoverflow.

can you guys help me debug?

Heres the problem, this query is selecting all of the rows from my database, its only outputting the first one twice for some reason.

  $top10_query = "SELECT * FROM kicks";
  $result = mysqli_query($cxn, $top10_query) or die("Couldn't execute query.");
  $row = mysqli_fetch_assoc($result);

  $rating = $row['rating'];
  $description = $row['description'];
  $completed = $row['completed'];
  $userid = $row['userid'];
  $posted = $row['posted'];

  while($row = mysqli_fetch_assoc($result)) {
   echo "<tr>";
    echo "<td class='rating'>" . $rating . "</td>";
    echo "<td class='description'>" . $description . " </td>";
    echo "<td class='completed_" . $completed . "'>" . $completed  . "</td>";
    echo "<td class='author'>";
     echo "Posted by: <a href='profile?userid=" . $userid . "'>" . $userid . "</a><br />";
     echo "on "; echo $posted;
    echo "</td>";
   echo "</tr>";
  }
  • 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-05-16T08:34:15+00:00Added an answer on May 16, 2026 at 8:34 am

    You are looping over the rowset, but never retrieving its value more than once. You pulled all of the values out of the first row, and cached them here:

    $rating = $row['rating'];
    $description = $row['description'];
    $completed = $row['completed'];
    $userid = $row['userid'];
    $posted = $row['posted'];
    

    Move this code into the loop, and remove the first fetch.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 515k
  • Answers 515k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer As you asked for source code: From HERE you can… May 16, 2026 at 6:38 pm
  • Editorial Team
    Editorial Team added an answer Database will be the preference, for persistence, but you can… May 16, 2026 at 6:38 pm
  • Editorial Team
    Editorial Team added an answer You can do it in sed as: sed -r -i… May 16, 2026 at 6:38 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Hey guys, first off all sorry, i can't login using my yahoo provider. anyways
Hey guys, This is my first time making an app with any kind of
Hey guys, this is my first time actually posting at stackflow but i've used
Hey guys I have one more question lol. I am using a script that
Hey guys, throughout google's GoogleMap API, the standard coordinates formating is Latitude first, then
Hey guys, I've been bashing my head around for hours now, over this login
Hey guys, I'm using GWT for a data-driven web application, and I'm having issues
Hey I have this code right here: http://pastie.org/534470 And on line 109 I get
Hey guys, im not well versed in dealing with asynchronous design patterns, and im
Hey guys I have a quick question, I have a dialog box that has

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.