Pagination, PHP Search Results
Posted: Mon Sep 21, 2009 7:27 pm
I am currently trying to fix a bug in a requests system which I have designed in PHP for my radio stations new website.
In a nutshell:
There is a text field (part of a form) which the user fills in. Upon pressing submit, the user is then presented with the search results (from an SQL Query, using a MYSQL database). This is a self driven PHP page.
My dilemna is that I would like to see only 5 results per page. I understand that we have to use something called Pagination, but have no idea how to go about it, and can't find any simple examples on the t'internet.
Thanks for your time!
Drumking88
In a nutshell:
There is a text field (part of a form) which the user fills in. Upon pressing submit, the user is then presented with the search results (from an SQL Query, using a MYSQL database). This is a self driven PHP page.
Code: Select all
while($row = mysql_fetch_array($result))
{
echo '<form method = "POST" action = "check_request.php">';
echo '<table border = "">';
echo '<tr>';
echo '<td width = "200">';
// echo $row['title'];
$item = $row['Title'];
$artistFirstName = $row['Name'];
$artistSurname = $row['Surname'];
$artistFullName = $artistFirstName. " ".$artistSurname;
echo '<input type = "hidden" name = "song_name" value = " '. $item.' ">';
echo $item;
echo '</td>';
echo '<td>';
echo '<input type = "hidden" name = "artist" value = " '.$artistFullName.'">';
echo $artistFullName;
echo '</td>';
/*echo '<td>';
echo $row['content'];
echo '</td>';
*/
echo '<td>';
echo '<input type = "submit" name = "submit" value = "Request It Now ">';
echo '</td>';
echo '</tr>';
echo '</table>';
Thanks for your time!
Drumking88