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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:12:39+00:00 2026-06-16T01:12:39+00:00

What i am trying to do is display all the purchases i currently have

  • 0

What i am trying to do is display all the purchases i currently have in my Puchase table. I want it so it displays the purchase Items which it does, however, i am trying to make it look like this:

Purchase Item 1

Click for more info links to ?info=ID and shows the rest of the information

This is the code i currently have:

<?php
$sql="SELECT PurchaseID, FrameNumber, Date From Purchase WHERE Email = '$id'";
$purchases = mysqli_query($con, $sql);
while(list($purchaseid, $framenumber, $date) = mysqli_fetch_row($purchases)){           
                echo "
                <table width=\"100%\">
                <tr>
                <th>PurchaseID:</th>
                <th>Date Of Purchase:</th>
                <th>FrameNumber:</th>
                <th>More Details</th>
                </tr>
                <tr>
                <td>$purchaseid</td>
                <td>$date</td>
                <td>$framenumber</td>
                <td><a href=\"myaccount.php?info=$framenumber\">Click Here</a></td>
                </tr>
                </table>";
$info = $_GET['info'];
if($info){
$fnumber = mysqli_query($con, "SELECT BikeCode FROM BikeStock WHERE FrameNumber = '$info'");
while(list($bikecodes) = mysqli_fetch_row($fnumber)){   

$bikes = mysqli_query($con, "SELECT * From Bike WHERE BikeCode = '$bikecodes' LIMIT 1");
while(list($bikecode, $manufacturer, $model, $subtype, $year, $fmaterial, $desc, $gender, $type, $price, $stock) = mysqli_fetch_row($bikes)) {
    echo "<table><tr><th>BikeCode:</th>
          <th>Manufacturer:</th>
          <th>Model:</th>
                    <th>FrameMaterial:</th>
          <th>Year:</th>
          </tr>
          <tr>
          <td>$bikecode</td>
          <td>$manufacturer</td>
          <td>$model</td>
          <td>$fmaterial</td>
          <td>$year</td>
          </tr>
          <tr><th>Description:</th><td colspan=\"4\">$desc</td></tr>
          <tr><th>Bike Images:</th><td colspan=\"4\">
          <div id=\"gallery\">";

    $sql = "SELECT SourcePath, Description FROM BikeImages where bikecode = '$bikecode'";
    $result = mysqli_query($con, $sql) or die('Query2 failed: ' . mysqli_error($con));
    while(list($sourcepath, $description) = mysqli_fetch_row($result)) {
          echo "<a class=\"gallery\" href=\"$sourcepath\" title=\"$description\"><img src=\"$sourcepath\" width=\"72\" height=\"72\" /></a>";
    }
echo "</div></td></tr></table>";
}
}
}
}
?>

EDIT:
The Problem i am currently having is that when i click on more info it displays all the information of all three items instead of only just one. I have LIMITED the SQL to only grabbing one product, however, it just repeats the product on the other purchase ID even tho its not the correct product.

My Current Output looks like this:

Purchase Item 1:

Information displayed

Purchase Item 2:

Information display even though i do not want it to be displayed i just want purchase item 1 information to be displayed.

  • 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-16T01:12:41+00:00Added an answer on June 16, 2026 at 1:12 am

    You need to write if as below

    if($info && $info==$framenumber){
    ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to display all such rows of a table STUDENTS which have a
I'm trying to display all selected items from a listbox into a textbox. Currently
I am trying to display all of the products showing the dates they have
I'm trying to display all orders placed and I have a primary accessdatasource control
I have a list of objects and I am trying to display them all
I am trying to display all the names from the table vocabulary where the
I'm trying to display all the users I have not voted on yet! CREATE
I have a MySQL table which contains a list of all possible products a
I am trying to display all categories (from my table Category) with radio buttons.
I am trying to display all records from my table CarCollection using the following

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.