TIMEDIFF: Good Way to Stop Negative Time from Showing (using php & mysql)

Could you tell me how I could stop showing the countdown of time on my webpage once the timer hits 0 seconds? The following IF statement in the body doesnt hide the timer once the time difference hits a negative value.

<?php
////Time Diff////////////////////////////////////////////////////////////////////////////////////////////////////
$query_Resource_Gold_time ="SELECT TIMEDIFF(upgrade_date, now())AS date_diff_gold
FROM tbl_resource_gold WHERE village_id = '" . $colname_Resource_Gold . "'";
$Resource_Gold_time = mysql_query($query_Resource_Gold_time, $Killercube) or die(mysql_error());
$Resource_Gold_time_result = mysql_fetch_array($Resource_Gold_time);

////Time Diff////////////////////////////////////////////////////////////////////////////////////////////////////
?>
  <p>Time to upgrade: <?php if ($Resource_Gold_time_result['date_diff_gold']<=0){ // Show if the timediff is =>0
                              echo $Resource_Gold_time_result['date_diff_gold'];
                              }?>
rhinez0rzAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
CetusMODConnect With a Mentor Commented:
PAQed with points refunded (500)

CetusMOD
Community Support Moderator
0
 
rhinez0rzAuthor Commented:
Got it -

$Resource_Gold_time_result['date_diff_gold']>='0'

I didnt use the single quotes around the 0, this appears to work.
0
 
Richard QuadlingSenior Software DeveloperCommented:
If you've answered your own question, ask community support to paq and refund the points.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.