This is really weird. I totally had this code working. I added some pagination and couldn't get that to work so I took it out. Now I can't get this to work.
When I manually run the query, I return 15 rows. When this code runs, it displays 15 rows but there is no data in there.
I'm thinking the problem might have something to do with...
$row_array = mysql_fetch_row($result);
...because $row_array[any_variable] comes back with nothing in it.
I really need a fresh pair of eyes to look at this.
$sql="SELECT student_id, first_name, last_name, address, city, state, zip, DOB, gender, grade, aka FROM student WHERE last_name LIKE '".$_GET['last']."%' and current_student='yes' ORDER BY last_name";
$conn = db_security_connect();
$result = mysql_query($sql,$conn);
$oddrow=true;
for ($i = 0; $i < mysql_num_rows($result); $i++) {
$row_array = mysql_fetch_row($result);
if ($oddrow) {
$oddrow=false;
$classtype="evenrow";
} else {
$oddrow=true;
$classtype="oddrow";
}
echo '<tr class="'. $classtype. '">';
echo '<TD><a href="notes.php?student_id='.$row_array[student_id].'">'.$row_array[student_id].'</a></TD>';
echo '<TD>'.$row_array[last_name].', '.$row_array[first_name];
if (!empty($row_array[aka])){
echo ' aka ("'.$row_array[aka].'")';
}
echo '<br>'.$row_array[address].' '.$row_array[city].', '.$row_array[state].' '.$row_array[zip].'</TD>';
echo '<TD>'.$row_array[DOB].'</TD>';
echo '<TD>'.$row_array[gender].'</TD>';
echo '<TD>'.$row_array[grade].'</TD>';
echo("</TR>");
}