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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:48:40+00:00 2026-06-15T11:48:40+00:00

I am trying to make a simple stock exchange application in PHP and have

  • 0

I am trying to make a simple stock exchange application in PHP and have a completely working session-based login system. Now I am having an issue listing the stocks a user has in a table. When I run the exact query that I have made in my PHP code in Navicat, the query returns the desired results, but PHP will not use the information to populate the table. The 0 in current value is a placeholder until I implement the YQL code required to pull stock information. I have a screenshot showing just about everything necessary to view what I am talking about:

screenie

My PHP code for the query is here:

echo "Welcome to your portfolio overview. Here you can view many of your statistics.<br><br><b>Balance:</b> " . $balance . "<br><b>Debt:</b> " . $debt . "<br>";
$sql2 = "SELECT * FROM `trades` WHERE buyerid=$uid";
$result2 = mysql_query($sql2);
echo "<table border=2 cellpadding=5>";
echo "<tr><td><b>Symbol</b></td><td><b>Purchase Price</b></td><td><b>Current Value</b></td></tr>";
while($row2 = mysql_fetch_array($result2));
{
    echo "<tr><td>" . $row2['identifier'] ."</td><td>" . $row2['purchaseprice'] . "</td><td>" . 0 . "</td></tr>";
}
echo "</table>";
  • 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-15T11:48:41+00:00Added an answer on June 15, 2026 at 11:48 am

    You have an erroneous semicolon after the while condition:

    while($row2 = mysql_fetch_array($result2));
                                              ^ -- remove this
    

    With this semicolon in place, you loop over an empty statement until your resultset is exhausted and then you execute the echo statement contained within your braces (with $row2 now false) irrespective of the while loop before.

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

Sidebar

Related Questions

Trying to make simple minesweeper game in python, but have one problem. I have
I am trying to make simple notepad application for learning android development. So, to
I am trying to make a simple Queue class. Now I am stuck. Its
We're currently stuck trying to make a simple (?) SQL query. We have these
I have been trying to make a simple web service and have been following
I am trying to make a simple Windows Form application that will show different
I am trying to make a simple load more button where I have an
I'm trying to make simple website with content background combined from 3 images: top
I'm trying to make simple script using jquery $post function to pass data to
I am fairly new to iOS development and trying make a simple app which

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.