Hello all
I am creating a page that dynamically updates as tables are added and removed from the database.
Like so:
#connect to mysql
$conn = @mysql_connect("localhost", "root", "*****")
or die("Err:Conn");
#select db
$rs = @mysql_select_db("ecf_training", $conn)
or die("Err:Db");
$query="SELECT * FROM class";
$result=mysql_query($query);
$num=mysql_numrows($result);
$i=0;
if($num != 0){
echo("<table class = 'courses' border = '1' BORDERCOLOR = 'black' cellpadding='0' cellspacing='0'>
<tr class = 'black'>
<td>Date</td>
<td>Course</td>
<td>Time</td>
</tr></font>");
while ($i < $num) {
$date=mysql_result($result,$i,"date");
$type=mysql_result($result,$i,"type");
$time=mysql_result($result,$i,"time");
echo("
<tr>
<td>$date</td>
<td>$type</td>
<td>$time</td></tr>
");
$i++;
}
And that works beautifully.
But I would like to add another column in the table that will echo the number of registered users in each class.
I know the code to get that done; however, I don't know how to access each class indivually.
Any ideas?
Thanks in advance :)
lg