MySQL Forums
Forum List  »  PHP

MySQL/PHP Query Issue
Posted by: Nicholas O'Neill
Date: August 16, 2005 10:04AM

Hi Everyone!

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 ((UNIX_TIMESTAMP()-ranked_start)/60/60) AS duration_hours FROM headline_images;


The result displays the correct number of hours that it was ranked on the scoreboard. Next in the php I state:

Code:
$sql = "SELECT ((UNIX_TIMESTAMP()-t1.ranked_start)/60/60) AS duration_hours FROM headline_images AS t1";
$result = mysql_query( $sql )....... yada yada

Anyways, the result continuously displays 0.0000. Can anyone help me out?

Thanks!

Options: ReplyQuote


Subject
Written By
Posted
MySQL/PHP Query Issue
August 16, 2005 10:04AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.