Okay, I put this on hold for a while but now I'm back on it.
So here's what I'm doing...
First I select the list of schools....
$sqlSchool="SELECT DISTINCT school FROM active";
Then for each instance in the result set I need to create a query to pull the student info associated with each school.
while ($rowSchool = mysql_fetch_array($resultSchool)){
$sql="SELECT school, last_name, first_name, six_digit, home_address, disability, one_bus, one_time, two_bus, two_time FROM active WHERE school='".$rowSchool[school]."'ORDER BY school LIMIT $offset, $rowsPerPage";
$result = mysql_query($sql,$conn);
for ($i = 0; $i < mysql_num_rows($result); $i++) {
echo("<TR>");
$row_array = mysql_fetch_row($result);
for ($j = 0; $j < mysql_num_fields($result); $j++) {
echo("<TD align=left>" . $row_array[$j] . "</TD>");
}
echo("</TR>");
}
}
This does not work as expected. I receive the following error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource
Finally, I need to implement the pagination. The rows per page should differ depending on the number of rows for each school.
This whole problem seems like it should be a fairly common exercise. If anyone can help, I would really appreciate it.
Thanks,
Scott