samedi 18 avril 2015

how to view product list 3 image per row. another image will view in another row

PHP Code:



<?php include "connectdb.php"; ?>
<?php $sql=mysql_query("SELECT * FROM Product where prdCtg='Shawl'");
$productCount = mysql_num_rows($sql);
if($productCount > 0) {
$productList .= "<table class='senarai' Border=0 width=840 cellpadding=5 cellspacing=0 ><tr> ";
$countitem=0;
while($row = mysql_fetch_array($sql))
{
if ($countitem>3) {
$productList .= "</tr><tr>"; $countitem=0;
}
else {
$countitem++;
}
$id = $row["prdId"];
$image = $row["prdImg"];
$productList .= "<tr>";
$productList .= "<td align=center><a href=PrdView.php?pid=$id><IMG SRC=$image File WIDTH=100 HEIGHT=150 /></a></td>";
$productList .= "</tr></table> ";
}//while }//if else { $productList = " There is no product in database "; } ?>


HTML:



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://ift.tt/kkyg93">
<html xmlns="http://ift.tt/lH0Osb" lang=''>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>List of Product in My Store</title>
<link rel="stylesheet" href="style/styles.css">
<script src="http://ift.tt/J5OMPW" type="text/javascript"></script>
<script src="Javascript/script.js"></script>
<link href="style/kotak.css" rel="stylesheet" type="text/css" />
</head>
<body bgcolor='#FFFFFF' class="news">
<table border="0" align="right" width="1000">
<tr>
<td align="right">
<a href="http://ift.tt/1FUEDC0">
<img src="image/fb.PNG" width="25" height="25" /></a>&nbsp;
<a href=http://ift.tt/1Q0P4MD src="image/twitter.PNG" width="25" height="25" /></a>&nbsp;<a href="">
<img src="image/VC.jpg" width="70" height="35" /></a>
</td> </tr> </table> <table border="0" align="center" width="1200"> <tr> <td>
<header>
<div id='cssmenu'>
<ul> <li class='active'><a href="index.php"><span>Home</span></a></li>
<li class='has-sub' ><a href='#'><span>Products</span></a>
<ul> <li><a href='ShawlList.php'><span>Shawl</span></a></li>
<li><a href='InstantList.php'><span>Instant Shawl</span></a></li>
<li class='last'><a href="BawalList.php"><span>Bawal Shawl</span></a></li> </ul>
</li>
</ul> </div> </header> </td>
<td > <center><a href="index.php"><img src="image/logoo.png" ></a></center></img> </td>
<td> <header> <div id='cssmenu'> <ul> <li class='has-sub'><a href='#'>
<span>About</span></a> <ul> <li><a href='#'><span>Company</span></a></li>
<li class='last'><a href='#'><span>Contact</span></a></li> </ul> </li>
<li class='last'><a href='#'><span>Contact</span></a></li> </ul> </div>
</header> </td> </tr> </table> <br /> <center>
<table > <tr> <td><?php echo $productList ?></td> </tr> </table></center>
</body>
<div id="footer">
<center><font size="-1" color="#999999">All Right Reserved © 2015 RS</font> </center>
</div>
</html>



Aucun commentaire:

Enregistrer un commentaire