Hi!
i have created a search engine which returns results from a mysql database.
what i want is that when the number of results get greater than 10 then the script should print a "View more results" link after those 10 results are displayed.
And when the user clicks "View more results" link, then the page that follows (lets call it 'searchnext.php') should show the remaining results excluding the results on the previous page.
Could u plz help me with this bcoz its just more than a couple of weeks that i have touched PHP.
Maybe i am asking too much but well .....i guess this is the purpose of this forum🙂
important part of code is:
// display results in html table
echo "<table>";
// format results by row
while ($row = mysql_fetch_array($sql_result) && $number_of_results) {
$name = $row["name"];
$address = $row["address"];
$level = $row["level"];
$phone_num = $row["phone_num"];
$fax_num = $row["fax_num"];
$email_address = $row["email_address"];
$website = $row["website"];
$virtual_tour = $row["virtual_tour"];
$admission = $row["admission"];
$scholarship = $row["scholarship"];
echo "<tr><td bgcolor=\"#82C0FF\"><b>Name:</b></td><td $name</td></tr>
<tr><td><b>Address:</b></td><td >$address</td></tr>
<tr><td><b>Level:</b></td><td >$level</td></tr>
<tr><td><b>Phone Number:</b></td><td >$phone_num</td></tr>
<tr><td><b>Fax Number:</b></td><td >$fax_num</td></tr>
<tr><td><b>Email Address:</b></td><td>$email_address</td></tr>
<tr><td><b>Website:</b></td><td>";
if ($website == 'Not Available') {
echo "$website</td></tr>";
} else {
echo "<a href=\"$website\" target=\"_blank\">$website</a></td></tr>";
}
echo "<tr><td><b>Virtual Tour:</b></td><td>$virtual_tour</td></tr>
<tr><td><b>Admissions:</b></td><td>$admission</td></tr>
<tr><td><b>Scholarships:</b></td><td>$scholarship</td></tr>";
}
echo "</table>";
Thanks in advance.
Kamran