Jump to content

Recommended Posts

Can someone help with this I want to find how many of each differant fields are associated with another field I dont really know how to explain it so heres a link p.htm to show what is happening with the 1st portion of code On the linked page I show what I need it to look like. the second portion of code below is what I was trying to make work to accomlish it but dont know how or even if its the way to do it..

 

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
mysql_query($query);
$query = "SELECT Attend_Round, COUNT(Monster_Truck) FROM Entry_Form GROUP BY Attend_Round"; 
 $result = mysql_query($query) or die(mysql_error());

// Print out result
while($row = mysql_fetch_array($result)){
echo $row['Attend_Round'] ." ". $row['COUNT(Monster_Truck)'] ." items.";
echo "<br />";
}
?>

 

$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>$[b][/b]Attend_Round<br>$Eighth_Scale_Buggy<br>$Eighth_Scale_Sportsman<br>$Arena_Truck<br>$Monster_Truck<br>$Stadium_Truck<hr>";

$i++;
}

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.