i am new to php & mysql, actually just last week.
i have at least 5000 rows on my table and i've been looking for a "php pagination" on google but before i've gone through the page 6 i quited reading.at least realized how tired i was to read them all.
below is my script, it gives good results, but is there any way to have my queries on pages. 😕.
please help. any input is appreciated.
$query = mysql_query("SELECT * FROM $usertable WHERE $method LIKE '%$search%' ORDER BY $sort");
?>
<?php
$result = mysql_num_rows($query);//counts the number of matched queries.
echo "<br/>Found <strong>". $result . "</strong> Match(s).";
echo " Search Results sorted by <b>$sort.</b><br>";
//check if no matches found then say so.
if(!$result){
echo "<center><span class='xbig'><br><br>No Matches Found!</span>";
echo "<br><strong><a href='javascript: history.go(-1)'>Search Again?</a></strong></center>";
mysql_close();
}else{
while ($row = mysql_fetch_array($query)){
echo "<hr/>";
echo "<table><tr><td>";
echo "<img src='imgs/edit.jpg'/></td></tr></table>";
echo "<table class='medium'>";
echo "<tr><td>Costumer ID:</td><td><font color='#FF000'>".$row['ID']."</strong></td></tr>";
echo "<tr><td>Classification:</td><td>".$row['Class']."</td></tr>";
echo "<tr><td>Name:</td><td><font color='#009900'><strong>".$row['Ename']."</strong></font></td></tr>";
echo "<tr><td>Address:</td><td>".$row['Bar'].", ".$row['Mun'].", ".$row['Pro']."</td></tr>";
echo "<tr><td>Telephone:</td><td><font color='#3366CC'>".$row['Tel1']." / ".$row['Tel2']."</fomt></td></tr>";
echo "<tr><td>Fax:</td><td>".$row['Fx']."</td></tr>";
echo "<tr><td>Contact Person:</td><td>".$row['CP']."</td></tr>";
echo "<tr><td>Purchase Records:</td><td>".$row['PR']."</td></tr>";
echo "<tr><td>Mode of Payment:</td><td>".$row['MoP']."</td></tr>";
echo "<tr><td>Status:</td><td>".$row['Stat']."</td></tr>";
echo "</table>";
echo "<br>";
}