Forum Moderators: coopster
This is what I have:
$new = mysql_query("SELECT Tabel1.*, Table2.* FROM Table1, Table2 WHERE Table1.Status = 'New' AND Table1.IdNo = Table2.IdNo ORDER BY Table1.yy, Table1.mm, Table1.dd, Table1.idNo");
$new_row=mysql_fetch_array($new);
function display_days($row,$result){
global $new;
global $new_row;
$currDay = "";
while($row=mysql_fetch_array($result))
if($currDay!=$row['day']){
<table><caption>
</caption>
<tr><th>ID Number</th><th>
Surname</th><th>
First name</th><th>
<?PHP
$currDay = $row['day'];
}
?>
<tr>
<td> <?PHP echo $row['IdNo'];?> </td>
<td> <?PHP echo $row['Sname'];?> </td>
<td> <?PHP echo $row['Fname'];?> </td>
</tr>
<?PHP
}
}
?>
<?PHP display_days($new_row,$new);?>
I believe it to be something to do with the while loop because if I view the array before the loop it displays it all but once it enters the loop it drops the first row.