joyce
Sun 23rd Dec '01, 10:44pm
wat is wrong with my query?? what i'm trying to get is to select out the highest score for the month. the time_finish are stored as UNIX_TIMESTAMP.
$month = date(n);
$year = date(Y);
SELECT taker_name FROM quirex_record WHERE quiz_id = '$quiz_id' and month(UNIX_TIMESTAMP(time_finish)) = $month and year(UNIX_TIMESTAMP(time_finish)) = $year ORDER BY (no_correct/no_total) DESC, no_total DESC, (time_finish - time_begin) ASC, time_finish DESC LIMIT 1
$month = date(n);
$year = date(Y);
SELECT taker_name FROM quirex_record WHERE quiz_id = '$quiz_id' and month(UNIX_TIMESTAMP(time_finish)) = $month and year(UNIX_TIMESTAMP(time_finish)) = $year ORDER BY (no_correct/no_total) DESC, no_total DESC, (time_finish - time_begin) ASC, time_finish DESC LIMIT 1