PHP/SQL Question: I have 3 values entered into a database from a form, I am

Louise

New member
adding these values 2gether in php? and I need to print out the biggest sum of these values together. Some code below:
$fname = $_POST['fname'];
$surname = $_POST['surname'];
$student_number = $_POST['student_number'];
$exam = $_POST['exam'];
$project = $_POST['project'];
$participation = $_POST['participation'];
$totalmark = $exam + $project + $participation;
$sqlquery = "INSERT INTO details VALUES ('$fname', '$surname', '$student_number', '$exam', '$project', '$participation')";
$results = mysql_query($sqlquery);

Im not sure what to do next. I thought I could do the following:
if
max $totalmark
{
echo "Highest grade is" . $totalmark;
}

but that wouldnt work as it wont give highest grade from all the values in the database.
Any ideas??? thanks.
 
Back
Top