Jump to content

Trouble with remaining time display.


Greaser9780

Recommended Posts

At this point I don't even know what type to set my field to in my table.

I have a table where I keep a value"expirytime".

I have tried TIME,DATETIME,TIMESTAMP and get nothing but an undesireable result. Here is my code for the script that displays time remaining in minutes and seconds:

<?php

include("db.php");

$blah=mysql_query("SELECT exptime FROM time ");

$rst=mysql_fetch_array($blah);

$n= time();

$t=$rst["exptime"];

$disp=$t - $n;

echo $t ;

echo"<br>";

echo $n;

echo"<br>";

$minutes = floor($disp /3600);

echo date("i:s",$minutes) ;

include("login.php");

 

?>

I think the main problem is I can't seem to get $n and $t to be displayed in the same format. I banged my head against the wall for hours last night. Any help is greatly appreciated.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.