I want to calculate the percentage of progressDone
by adding all progressDone
and dividing it with the numbers of progress done. it is not working and i am also getting error
resource(4) of type (mysql link)
Notice: Object of class stdClass could not be converted to int
$query = "SELECT SUM(progressDone) AS totall, COUNT(progressDone) AS done FROM progress, progressType WHERE progress.projectID='$projectID' AND progress.progressTypeID='1'";
$result = mysql_query($query, $db)
or die("Query failed: ".mysql_error()." Actual query: ".$query);
$online = mysql_fetch_object($result);
$total = done; //done from the sql statement
$current = $online;
$percent = (($current/$total) * 100);
$percentNot = 100 - $percent;