Jump to content

Recommended Posts

Hi I got this iff Barand - thanks.

 

I just can't get it to work. Am I doing something wrong?

 

<?php 

//Connect to mysql server
$link=mysql_connect("localhost","AAA","AAA");
if(!$link) {
	die('Failed to connect to server: ' . mysql_error());
}
//Select database
$db=mysql_select_db("bbmembers");
if(!$db) {
	die("Unable to select database");
}

$qry="SELECT * FROM auctions WHERE uan=2";



$end = strtotime ($db_enddate);   // enddate from the db record for the item
$seconds_left = $end - time();

$days_left = floor($seconds_left / 86400);
$seconds_left = $seconds_left % 86400;

$hours_left = floor($seconds_left / 3600);
$seconds_left = $seconds_left % 3600;

$mins_left = floor($seconds_left / 60);
$seconds_left = $seconds_left % 60;

echo "$days_left days $hours_left hours $mins_left minutes $seconds_left seconds left";
?> 

 

The output is : -13780 days -20 hours -57 minutes -50 seconds left

 

Thanks,

Sam.

Link to comment
https://forums.phpfreaks.com/topic/70372-solved-display-time-left/
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.