include($DOCUMENT_ROOT .'/include/db_connect.php')?>
if (!($limit)){
$limit = 10;} // Default results per-page.
if (!($page)){
$page = 0;} // Default page value.
$numresults = mysql_query("SELECT * FROM current_news WHERE id LIKE '%". $query ."%'"); // the query.
$numrows = mysql_num_rows($numresults); // Number of rows returned from above query.
if ($numrows == 0){
echo("No results found matching your query - $query"); // bah, modify the "Not Found" error for your needs.
exit();}
$pages = intval($numrows/$limit); // Number of results pages.
// $pages now contains int of pages, unless there is a remainder from division.
if ($numrows%$limit) {
$pages++;} // has remainder so add one page
$current = ($page/$limit) + 1; // Current page number.
if (($pages < 1) || ($pages == 0)) {
$total = 1;} // If $pages is less than one or equal to 0, total pages is 1.
else {
$total = $pages;} // Else total pages is $pages value.
$first = $page + 1; // The first result.
if (!((($page + $limit) / $limit) >= $pages) && $pages != 1) {
$last = $page + $limit;} //If not last results page, last result equals $page plus $limit.
else{
$last = $numrows;} // If last results page, last result equals total number of results.
//escape from PHP mode.
?>
TecTao Designs - Tampa Bay Web, eCommerce and Flash Design
if ($page != 0) { // Don't show back link if current page is first page.
$back_page = $page - $limit;
echo("back \n");}
for ($i=1; $i <= $pages; $i++) // loop through each page and give link to it.
{
$ppage = $limit*($i - 1);
if ($ppage == $page){
echo("$i \n");} // If current page don't give link, just text.
else{
echo("$i \n");}
}
if (!((($page+$limit) / $limit) >= $pages) && $pages != 1) { // If last page don't give next link.
$next_page = $page + $limit;
echo(" next\n");}
?>
//Go back into PHP mode.
// Now we can display results.
$results = mysql_query("SELECT * FROM current_news WHERE id LIKE '%". $query ."%' ORDER BY n_date DESC LIMIT $page, $limit");
//while ($data = mysql_fetch_array($results))
//{
while ($row = mysql_fetch_array($results))
{
extract($row);
// $row_color = ($row_count % 2) ? $color1 : $color2;
$date = "$datein";
$convertedDateStart = date("m/d/Y", strtotime($n_date));
?>
$row_count++;
}
mysql_close;
?>
if ($page != 0) { // Don't show back link if current page is first page.
$back_page = $page - $limit;
echo("back \n");}
for ($i=1; $i <= $pages; $i++) // loop through each page and give link to it.
{
$ppage = $limit*($i - 1);
if ($ppage == $page){
echo("$i \n");} // If current page don't give link, just text.
else{
echo("$i \n");}
}
if (!((($page+$limit) / $limit) >= $pages) && $pages != 1) { // If last page don't give next link.
$next_page = $page + $limit;
echo(" next\n");}
?>
Servicing clients throughout the Tampa Bay, Florida area including: Tampa, St. Petersburg (Saint Petersburg, St. Pete), Sarasota, Clearwater, Palm Harbor, Venice, Fort Meyers, Naples and Lakeland since 1998.