Why am i saying 'finder' ? not enough coffee :-) i meant find a.

Raditha Dissanayake wrote:
Hello Ryan,
If you find the php date time functions not to your liking you will finder more easy to understand version in mysql.


all the best


Ryan A wrote:


Hi,
Thanks for replying.

Am a bit confused even after your example as to how to enter this into the
datetime field in mysql so that i can compare it to the present datetime


heres the code i made based on what you said:
<?php
$day=2;
$hour=2;
$seconds=05;

$theDay=24*60*60;
$theHour=60*60;
//$theSec=$seconds;

$FinalDay=$day*$theDay;
$FinalHour=$hour*theHour;

$offset=$FinalDay + $FinalHour + $seconds;
$FinalTime=time() + $offset;

print time();   echo "<br><br>";
print $FinalTime;  echo "<br><br>";
$Result=mktime($FinalTime);
echo $Result;//gives a warning or error
?>

Its giving me a number based on the above that is correctly higher than
time() but how do i enter that into mysql for a comparision?

eg:
my table structure in mysql is so:
present_day     datetime
expire_day      datetime
filename           varchar(50)

(my logic)
if ($present_day - $expire_day <= 0)
{echo "link expired";}
//else
//give file

Kindly reply,
-Ryan






--

Raditha Dissanayake
-------------------------------------------------------------
http://www.radinks.com/sftp/
Lean and mean Secure FTP applet with Graphical User Inteface.
just 150 Kilo Bytes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to