SEARCH for past Funerals  obit.php  


   
 


 


"; while ($row = mysql_fetch_row($result)) { $ID = $row[0]; echo " "; echo "". $row[1] . ""; echo "". $row[2] . ""; echo ""; // echo $row[5]."scs"; if($row[5]!=''){ echo ""; } echo "". $row[3] . "

...read more | add condolence"; echo ""; } echo ""; } // echo "$ page is :$page

"; if ($page > 1) { $pg = $page; $pageprev = $pg-1; // Fancy way of subtracting 1 from $page echo ("« previous ".$limit." "); } else { echo (" "); // If we're on page one, PREV is not a link. } // echo "$ page is : $page. and $ pageprev is : $pageprev"; $numofpages = $totalrows / $limit; /* We divide our total amount of rows (for example 102) by the limit (25). This will yield 4.08, which we can round down to 4. In the next few lines, we'll create 4 pages, and then check to see if we have extra rows remaining for a 5th page. */ for($i = 1; $i <= $numofpages; $i++){ /* This for loop will add 1 to $i at the end of each pass until $i is greater than $numofpages (4.08). */ if($i == $page){ echo("| ".$i." "); }else{ echo("| $i "); } /* This if statement will not make the current page number available in link form. It will, however, make all other pages available in link form. */ } // This ends the for loop if(($totalrows % $limit) != 0){ /* The above statement is the key to knowing if there are remainders, and it's all because of the %. In PHP, C++, and other languages, the % is known as a Modulus. It returns the remainder after dividing two numbers. If there is no remainder, it returns zero. In our example, it will return 0.8 */ if($i == $page){ echo("| ".$i." "); }else{ echo("| $i "); } /* This is the exact statement that turns pages into link form that is used above */ } // Ends the if statement if(($totalrows - ($limit * $page)) > 0){ /* This statement checks to see if there are more rows remaining, meaning there are pages in front of the current one. */ $pagenext = $page+1; // Fancy way of adding 1 to page echo("| next ".$limit." »"); /* Since there are pages remaining, this outputs NEXT in link form. */ }else{ echo " |"; /* If we're on the last page possible, NEXT will NOT be displayed in link form. */ } /* echo "

$ i is : $i

"; echo "$ page is :$page

"; echo "$ numofpages is : $numofpages

"; echo "$ pagenext is : $pagenext

"; */ mysql_free_result($result); /* This line is not required, since MySQL will free the result after all scripts have finished executing; however, it's a nice little backup. */ ?>