I'm currently working on a program that ranks something called "headline images". These images are ranked by users. Everytime a scoreboard page is loaded, the scores are recalculated, and each image is assigned a rank (1 being the highest, on down to 100 being the lowest). In addition to checking the rank, I also calculate the duration in which the image was ranked on the scoreboard. I tested the following query in MySQL:
Code: Select all
SELECT ((UNIX_TIMESTAMP()-ranked_start)/60/60) AS duration_hours FROM headline_images;Code: Select all
$sql = "SELECT ((UNIX_TIMESTAMP()-t1.ranked_start)/60/60) AS duration_hours FROM headline_images AS t1";
$result = mysql_query( $sql )....... yada yadaThanks!