Dear All
Please see below script & help me on, how to add pagination in this script.
Kindly help.
PHP Code:<!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" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>View Orders Details</title>
</head>
<body>
<?php
//$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
//$database="crosswea_tech6"; // Database name
$database="merchandising";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM newcomp ORDER BY ship_date ASC";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
?>
<table border="1" cellspacing="0" cellpadding="0" id="yourtablename">
<tr align="center" bgcolor="#817679">
<th>Buying House</font></th>
<th>Buyer</th>
<th>Department</th>
<th>Department For</th>
<th>Brand</th>
<th>Yaer</th>
<th>Season</th>
<th>Order No</th>
</tr>
<?php
$color1 = " #348781";
$color2 = " #ffffff";
$i=0;
while ($i < $num) {
$row_color = ($i % 2) ? $color1 : $color2;
$f6=mysql_result($result,$i,"buyinghouse");
$f1=mysql_result($result,$i,"buyer");
$f7=mysql_result($result,$i,"departmentname_no");
$f12=mysql_result($result,$i,"department_for");
$f8=mysql_result($result,$i,"year");
$f9=mysql_result($result,$i,"season");
?>
<?php echo '<tr bgcolor="'. $row_color .'" align="center">';?>
<?php echo '<td bgcolor="'. $row_color .'" align="center">';?> <font face="Arial, Helvetica, sans-serif"><?php echo $f6; ?></font></td>
<td align="center"><font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font></td>
<td align="center"><font face="Arial, Helvetica, sans-serif"><?php echo $f7; ?></font></td>
<td align="center"><font face="Arial, Helvetica, sans-serif"><?php echo $f12; ?></font></td>
<td align="center"><font face="Arial, Helvetica, sans-serif"><?php echo $f8; ?></font></td>
<td align="center"><font face="Arial, Helvetica, sans-serif"><?php echo $f9; ?></font></td>
</tr>
<?php
$i++;
}
?>
</TABLE>
</body>
</html>



Reply With Quote


Bookmarks