SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2006
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking incorrect value being shown

    ive got a script that supposed to show the items ordered along with the quantity ordered. however it showing the quantity that i have in stock. my is done by joining two of my tables. i dnt know if the problem is that in both my tables i have the same field called quantity. is their a way i can make the quantity read from the order_details table when running through the while loop

    PHP Code:
    $query1 "SELECT * FROM order_details, products where order_details.orderid='$orderid' and order_details.productid=products.productid";
            
    $result1 mysql_query($query1
            or die(
    mysql_error());
            
    $numrows mysql_num_rows($result1);
            while (
    $row1 mysql_fetch_array($result1))
            {
            
    extract($row1);
            
            echo 
    "| Product Name: ";
            echo 
    $product_name;
            echo 
    "&nbsp";
            echo 
    "&nbsp";
            echo 
    "&nbsp";
            echo 
    "| Product ID: ";
            echo 
    $productid;
            echo 
    "&nbsp";
            echo 
    "&nbsp";
            echo 
    "&nbsp";
            echo 
    "| Item Price ";
            
            echo 
    $item_price;
            echo 
    "&nbsp";
            echo 
    "&nbsp";
            echo 
    "&nbsp";
            echo 
    "| Quantity Ordered: ";
            
            echo 
    $quantity;
            echo 
    "<hr width=50%>"

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2006
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dnt worry its dne

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2004
    Location
    dublin, Ireland
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why not show us how you fixed it so that others with the same problem can see how it was done?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •