When I use the following code, I get 4... 4 is the total number of records I have in the db... only 1 has a class assigned to them...
<?php
do {
?>
<option value="<?php echo $row_ClassDetails['CDID']; ?>" >
<?php
$mysqldate = $row_ClassDetails['CDDate'];
$mydate = date("M, d Y",strtotime($mysqldate));
echo $mydate;
?> -
<?php echo $row_ClassDetails['CDName']; ?> - <?php
$cdid = $row_rtnUser['CDID'];
$rtnUID = $row_rtnUser['rtnUID'];
$sql = "SELECT COUNT(CDID) AS total FROM rtnUser GROUP BY CDID";
$query = mysql_query($sql);
$count=0;
while ($recordset = mysql_fetch_assoc($query))
{
$count++;
}
echo "$count";
?> of <?php echo $row_ClassDetails['CDMaximum']; ?> max.
</option>
<?php
} while ($row_ClassDetails = mysql_fetch_assoc($ClassDetails));
?>