$max=" SELECT max(value),element,scormid from mdl_scorm_scoes_track
WHERE scormid = '20' AND element = '$element'
GROUP BY value
ORDER BY value ";
$query=mysql_query($max);
while($Rs=mysql_fetch_array($query)){ echo $Rs['max(value)'];}
Code (SQL)
SELECT max(value),element,scormid from mdl_scorm_scoes_track
WHERE scormid = '20' AND element = '$element'
GROUP BY value
ORDER BY value
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* FROM mdl_scorm_scoes_trackWHERE scormid = '20' AND element = 'cmi.core.score.r' at line 1