hello All,
I need a page numbering system for PHP, I have some code that displays my db results and it works fine, All the tutorials I have found are like 3 pages and super advanced and i can't make heads or tails of them, ( 1 have one for ASP and its 10 lines of code) This is my code, if someone can help me modify it to add page numbering for all results over 5 ( or a EASY tutorial ) I would be very grateful ( it doesn't have to be fancy)
$sql = "SELECT * FROM $table_name WHERE catID = '$_REQUEST[id]' AND active = '1' ORDER BY busName ";
$result = @mysql_query($sql, $connection) or die("Error3 - ".mysql_error());
while($row = mysql_fetch_array($result)) {
$busID = $row['busID'];
$catID = $row['catID'];
$busName = $row['busName'];
$busEmail = $row['busEmail'];
$busLogo = $row['busLogo'];
$busPhone = $row['busPhone'];
$busUrl = $row['busUrl'];
$contact_list .= "<tr><td width='150' align='center' rowspan='2'>";
if($busLogo != "") { $contact_list .= "<img src='logo/$busLogo'>";}
$contact_list .= "</td>";
$contact_list .= "<td colspan='2' valign='top'><b>$busName</b></td></tr><tr>";
$contact_list .= "<td valign='top'><b>Email: </b><a href='mailto:$busEmail' class='buttons'>$busEmail</a><br><b>Tel: </b> $busPhone<br></td><td valign='top'>";
if($busUrl != "") { $contact_list .= "<b>Website : </b><a href='http://www.$busUrl' class='buttons' target='blank'>$busUrl</a> <br>";}
$contact_list .= "<a href='businessDetails.php?id=$busID' class='buttons'>More Details.....</a></td></tr>";
$contact_list .= "<tr><td colspan='3'><hr width='75%' color='#cccccc'></td></tr>";
} // end while
page numbering for many results
Moderator: General Moderators