First off I read through the below article from the beginning. I do have a better understanding of OOP in PHP that what I did before today but am stillhaving some problems. With the article on screen I proceeded to adapt the script accordingly to what I need done.
URL=http://www.sitepoint.com/article/php-paging-result-sets/5]OOP Pagination on Sitepoint[/URL]
My guess is as good as yours but I tracked the problem down to the while loop in my cresults.php file. I am getting the table, but none of the variables are coming through from the database and I know that I am connected.
[PHP
<?
include('inc/connect.inc');
include('pagedresults.php');
$table = "fwcems";
$limit = 10;
$totalrows = mysql_result(mysql_query("SELECT count(cem_id) FROM $table"),0);
$limitvalue = $page * $limit - ($limit);
if($totalrows == 0)
{
echo("Nothing to Display!");
}
$rs = new MySQLPagedResultSet("select * from fwcems where $stype LIKE $search",10,$connection);
echo "<HTML>";
echo "<head>";
echo "<title>".$ptitle."</title>";
echo "</head>";
echo "<body background=img/clouds.jpg bgproperties=fixed>";
echo "<CENTER>";
echo "<H1 align=center>Cemetery Search</H1>";
echo "<table border=0 width=50%>";
while ($row=$rs->fetchArray());
echo "<tr>";
echo "<td align=center colspan=2><Q>";
echo $row[1]." Cemetery</Q>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=center colspan=2>";
echo "<Q>Located at ".$row[3]."</Q>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=center>";
echo "Status: ";
echo "</td>";
echo "<td align=center>";
echo $row[2];
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=center>";
echo "Owner: ";
echo "</td>";
echo "<td align=center>";
echo $row[4];
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=center>";
echo "Phone #: ";
echo "</td>";
echo "<td align=center>";
echo $row[5];
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=center>";
echo "E-mail address: ";
echo "</td>";
echo "<td align=center>";
echo $row[6];
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=center colspan=2>";
echo "<HR color=#AA00FF>";
echo "</td>";
echo "</tr>";
echo "</table>";
$rs->getPageNav(" cem_id=$cem_id");
echo "</center>";
echo "</body>";
echo "</html>";
?>
[/code]
Your urgent response is greatly appreciated.
Sincerely;
KB9YJG
P.s. You can download the class file that was worked on in the article but I myself have caught only one variation in the sets of code.