Jump to content

display product details in a pop up window with close button only


Go to solution Solved by hance2105,

Recommended Posts

hey guys, i have created a page called prod_det.php. the page displays the details of the product. below is the code. but it is not working. error message being received when i click the details button is Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean

 

    <?php    session_start();    ?>     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">    <html xmlns="http://www.w3.org/1999/xhtml">    <head>    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />    <title>Product</title>    <link href="CSS/product.css" rel="stylesheet" type="text/css" />    </head>     <body>     <?php      //Create the connection and select the DB     include('db_connect.php');      // Select records from the DB      $query = "SELECT p.prod_name, p.prod_photo, pr.prod_price, pr.prod_desc, pr.prod_brand, pr.prod_w_c              FROM tblproduct p              INNER JOIN tblretprod pr ON p.prod_id = pr.prod_id";     $result = mysql_query($query);      // Display records from the table ?>     <?php while ($row = mysql_fetch_array($result)): ?>     <div class="prod_box_big">         <div class="top_prod_box_big"></div>            <div class="center_prod_box_big">                                              <div class="product_img_big"><?= '<img height="100" width="100" src="Images/Products/'.$row['prod_photo'].'"/>'; ?>                   <div class="thumbs"><?= $row['prod_desc']; ?></div>              </div>                     <div class="details_big_box">                         <div class="product_title_big"><?= $row['prod_name']; ?></div>                         <div class="specifications">                            Brand: <span class="blue"><?= $row['prod_brand']; ?></span><br />                             Quantity: <span class="blue"><?= $row['prod_w_c']; ?></span><br />                                                        Price include <span class="blue">TVA</span><br />                         </div>                         <div class="prod_price_big"><span class="reduce"><?= $row['prod_price']; ?></span> <span   class="price">%promo%</span></div>                                                  <a href="#" class="addtocart">add to fav</a>                         <a href="#" class="compare">compare</a>                     </div>                                    </div>            <div class="bottom_prod_box_big"></div>                                    </div>    <?php endwhile; ?>      </body>    </html>

now the issue is that there is a product details button for each product display. when i click on my product details button, details of all products are displayed and not the details of the product i clicked. Any help in solving that please?

  • 3 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.