Hi... I need some help over here... attached is my coding that will display all the result in a single page. I need to limit the result let say to 50 results per page. Anybody can help me out here? Million thanks in advance...
Code:
<?php
// Make a MySQL Connection
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("dbase") or die(mysql_error());
// Get all the data from the "defaulter" table
$result = mysql_query("SELECT * FROM `defaulter` WHERE `NamaMajikan` IS NOT NULL")
or die(mysql_error());
echo "<center> <br>";
echo "<table border='1' cellspacing='1' cellpadding='0'>";
echo "<tr> <th rowspan='2'> Kod Majikan </th> <th rowspan='2'>Nama Majikan</th> <th colspan='5'>Bilangan Bulanan</th> <th colspan='5'>Anggaran Amaun Tertunggak</th> <th rowspan='2'> Jumlah Besar </th></tr>";
echo "<tr><th> 2007 </th> <th> 2008 </th> <th> 2009 </th> <th> 2010 </th> <th> 2011 </th><th> 2007 </th> <th> 2008 </th> <th> 2009 </th> <th> 2010</th> <th> 2011 </th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo "<tr><td> ";
echo $row['KodMajikan'];
echo "</td><td> ";
echo $row['NamaMajikan'];
echo "</td><td align='center'>";
echo $row['Bil2007'];
echo "</td><td align='center'>";
echo $row['Bil2008'];
echo "</td><td align='center'>";
echo $row['Bil2009'];
echo "</td><td align='center'>";
echo $row['Bil2010'];
echo "</td><td align='center'>";
echo $row['Bil2011'];
echo "</td><td align='center'>";
echo $row['Amt2007'];
echo "</td><td align='center'>";
echo $row['Amt2008'];
echo "</td><td align='center'>";
echo $row['Amt2009'];
echo "</td><td align='center'>";
echo $row['Amt2010'];
echo "</td><td align='center'>";
echo $row['Amt2011'];
echo "</td><td align='center'>";
echo $row['JumlahBesar'];
echo "</td></tr>";
}
echo "</table></center>";
?>
thanks for your reply mate... but to my understanding, that will only show 50 results, am i right...
my concern is let say it will show 300 results, it will display 50 results in first page and another 50 results in all other page... that means all together will be 6 pages