php - SQL Count Down Timer -


i'm creating own penny auction script. i'm trying countdown timer work. since div refreshes every second anyway, don't need use jquery timer can go time of last bid.

i'm able time of last bid using sql call

$strfind="select * penny_bids `pennyid`=\"$pid\" order id desc limit 1"; $result=mysql_query($strfind) or die(mysql_error()); $row=mysql_fetch_array($result); $memname=$row['memname']; $btime=$row['time']; 

i thought current time minus btime give me time in seconds doesn't.

$time=time()-$btime;  gets me time stamp.  

how can get me 30 digits? counting down. each time div refreshes 29, 28, etc.

when dates , times out of mysql they'll typically come in yyyy-mm-dd hh:mm:ss format. if want php computations on them you'll have convert them timestamps strtotime(). alternativly, can mysql computation you. functions subtime or date_diff might useful you.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -