Hi all,
I am new to php & mysql and could really do with some advice as I have been struggling with this problem all day.
I am trying to workout a percentage via a result from a mysql column. The column contains server 2003 EventID error codes which have been generated by the OS.
i.e:
576
528
540
538
529 ..etc
Now I have managed to calculate the total occurrence of an error code using the following php:
$query = "SELECT EventID, COUNT(EventID) AS tt FROM audit3
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo "<br />";
echo $row['EventID']," ". $row['tt'] ." ";
echo "<br />";
}
?>
I really want to work out the percentage of the specific error codes. I know I will need another query to work out the total then divide and multiply to get the percent. But I can’t seem to solve the problem any guidance would be greatly appreciated.
I am new to php & mysql and could really do with some advice as I have been struggling with this problem all day.
I am trying to workout a percentage via a result from a mysql column. The column contains server 2003 EventID error codes which have been generated by the OS.
i.e:
576
528
540
538
529 ..etc
Now I have managed to calculate the total occurrence of an error code using the following php:
$query = "SELECT EventID, COUNT(EventID) AS tt FROM audit3
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo "<br />";
echo $row['EventID']," ". $row['tt'] ." ";
echo "<br />";
}
?>
I really want to work out the percentage of the specific error codes. I know I will need another query to work out the total then divide and multiply to get the percent. But I can’t seem to solve the problem any guidance would be greatly appreciated.