php dana katiya ikmanin help ekak dena

sudu hawa

Well-known member
  • Dec 1, 2011
    1,627
    100
    63
    yaluwane mama admin panel ekakin monava hari damahama mehema wetenwa ( a kiyanne yatata ) mata one meka left ekata row kara ganna anne danna katiya mata help ekak dennnaa

    image.jpg


    mena code eka full


    HTML:
    <?php 
    // Run a select query to get my letest 6 items
    // Connect to the MySQL database  
    include "storescripts/connect_to_mysql.php"; 
    $dynamicList = "";
    
    $sql = mysql_query("SELECT * FROM products ORDER BY date_added DESC LIMIT 6");
    $productCount = mysql_num_rows($sql); // count the output amount
    if ($productCount > 0) {
        while($row = mysql_fetch_array($sql)){ 
            extract($row); 
                 $id = $row["id"];
                 $product_name = $row["product_name"];
                 $price = $row["price"];
                 $date_added = strftime("%b %d, %Y", strtotime($row["date_added"]));
                 $dynamicList .= '<table width="100%" border="0" cellspacing="0" cellpadding="6">
            <tr>
              <td width="17%" valign="top"><a href="product.php?id=' . $id . '"><img style="border:#666 1px solid;" src="inventory_images/' . $id . '.jpg" alt="' . $product_name . '" width="77" height="102" border="1" /></a></td>
              <td width="83%" valign="top">' . $product_name . '<br />
                $' . $price . '<br />
                <a href="product.php?id=' . $id . '">View Product Details</a></td>
            </tr>
          </table>';
        }
    } else {
        $dynamicList = "We have no products listed in our store yet";
    }
    mysql_close();
    ?>
    <!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>Store Home Page</title>
    <link rel="stylesheet" href="style/style.css" type="text/css" media="screen" />
    </head>
    <body>
    <div align="center" id="mainWrapper">
      <?php include_once("template_header.php");?>
      <div id="pageContent">
      <table width="100%" border="0" cellspacing="0" cellpadding="10">
      <tr>
        <td valign="top"><h3>Latest Designer Fashions 
            </p>
          </h3>
          <p><?php echo $dynamicList; ?><br />
      </p>
          <p><br />
          </p></td>
        </tr>
    </table>
    
      </div>
      <?php include_once("template_footer.php");?>
    </div>
    </body>
    </html>