Take a look at this first to see what Im trying to do. "keep in mind im trying to figure out how to do this so the top of page may be chaging from time to time with my attemps, but the bottom is what my goal is to achieve which is not php or anything simplely a display of what I want to happen.
Here what I would like to use, but insted of display each entry individgualy just display the Attend_Round ie wichita rc raceway, track2. once then count how many times each of these Eighth_Scale_Buggy, Eighth_Scale_Sportsman, Arena_Truck, Monster_Truck, Stadium_Truck accour for the value of Attend_Round.
Im sure count is the right thing to do, but have tried many differant things with no succes. I dont know where to put it in the $query= 'SELECT line i guess.
PHP Code:
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
mysql_query($query);
$query= 'SELECT Attend_Round, Eighth_Scale_Buggy, Eighth_Scale_Sportsman, Arena_Truck, Monster_Truck, Stadium_Truck FROM Entry_Form';
$result=mysql_query($query);
$num=mysql_numrows($result);
if ($num==0) {
echo "";
}else{
echo "";
}
mysql_close();
$i=0;
while ($i < $num) {
$Attend_Round=mysql_result($result,$i,"Attend_Round");
$Eighth_Scale_Buggy=mysql_result($result,$i,"Eighth_Scale_Buggy");
$Eighth_Scale_Sportsman=mysql_result($result,$i,"Eighth_Scale_Sportsman");
$Arena_Truck=mysql_result($result,$i,"Arena_Truck");
$Monster_Truck=mysql_result($result,$i,"Monster_Truck");
$Stadium_Truck=mysql_result($result,$i,"Stadium_Truck");
echo "<B>$Attend_Round</b><BR>";
if ($Eighth_Scale_Buggy != ""){
echo "$Eighth_Scale_Buggy<BR>";
}
if ($Eighth_Scale_Sportsman != ""){
echo "$Eighth_Scale_Sportsman<BR>";
}
if ($Arena_Truck != ""){
echo "$Arena_Truck<BR>";
}
if ($Monster_Truck != ""){
echo "$Monster_Truck<BR>";
}
if ($Stadium_Truck != ""){
echo "$Stadium_Truck<BR>";
}
echo "<hr>";
$i++;
}
?>
Bookmarks