FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Jail Time





DanielXP
Im making a jail for my site but with the time it keeps saying this

"Time Left: 2.00611051641E+13"

I dunno why its doing it

in the database this is the timeout

20061105164142

2006 is the year 11 is the month 05 is the day 16 is the hours 41 minutes and 42 are the seconds

this is my script to get the error

Code:
$checkjail1 = mysql_query("SELECT username FROM jail WHERE username='$logged[username]'");
$checkjail = mysql_num_rows($checkjail1);
 
if($checkjail > 0) {
$jail = mysql_fetch_array($checkjail1);
$time = date("YmdHis");
$timeleft = $time - $jail[timeout];


Please help asap thanks
hexkid
DanielXP wrote:
[...]
Please help asap

http://www.sixside.com/fast_good_cheap.asp

You already chose "fast". I think you other choice would be "cheap";
So, just do what my signature says.
SlowWalkere
Your first problem is that you are only selecting "Username" from the table, so $jail[timeout] doesn't exist, only $jail[username]. There might also be some syntax problems, but I'm not sure, so do like hexkid said and bump up the error reporting in your script. Make sure your query is working properly and that $jail[timeout] is what it is supposed to be.

Also, why are you storing the time in that format? Why not use a simple timestamp from the time() function?

- Walkere
DanielXP
SlowWalkere wrote:
Your first problem is that you are only selecting "Username" from the table, so $jail[timeout] doesn't exist, only $jail[username].


Didn't notic this thanks
DanielXP
Can some one else help me.

When it displays the time it goes from

like 68 to 35 in like 3 seconds

this is the new code

Code:
$checkjail1 = mysql_query("SELECT * FROM jail WHERE username='$logged[username]'");
$checkjail = mysql_num_rows($checkjail1);
if($checkjail > 0) {
$jail = mysql_fetch_array($checkjail1);
$time = date("His");
$timeleft = $jail[timeout] - $time;
snowboardalliance
Did you try it with regular time()?
DanielXP
$time = date("His");

its same i think
Alie
Eh... Actually I can't understand your problem? Point after number 2?
Change of thease rows:
Code:
$time = date("YmdHis");
$timeleft = $time - $jail[timeout];

to this one:
Code:
$timeleft = time() - $jail[timeout];


Maybe it will help you...

One more thing, show us timeout variable $jail[timeout]. I think it can be a reason...
DanielXP
Thanks that works great now.

Before it didn't give out the correct time.
Related topics
Rape a 9 yr old child for 3 years, get 2 years in jail?!?!?!
Judge Sentences Hilton to 45 Days in Jail !
Paris Hilton begins jail term
Seven facing jail over barbaric dog fight
Principal, Athletic Director Could Face Jail Time For Prayer
five star jail - UK airspace closed
4 days jail for stealing 4 pork pies! Lol
New Xbox has chance to be No. 1, Gates says
How I Became A Madman
Murderers in Ciudad Juarez, Mexico
Sued for Spam
Me
Cassidy
Karla Homolka!
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.