...

View Full Version : date question



RedLineIT
10-20-2004, 04:25 AM
Hello everyone

ok i have a small problem which is really irritating.

I have a column in my db called online which has the time the user last clicked a link anywhere on the site. The date is then entered / updated in the following format. <?php echo date('D jS M Y :: G:i a');?>
which displays it like Wed 20th Oct 2004 :: 3:01 am

What i am trying to do is create a snippet of code so that on my admin page i can click a button and it will check the users table and look at the timeonline and if it is less than 30 minutes since it was updated ( ie since a link was clicked ) then it would reset their status to offline.

can anyone help with the snippet as i am stuck.

thank you

dswimboy
10-20-2004, 04:51 AM
I think your query would be like this:


UPDATE `user_table`
SET `status` = 'offline'
WHERE ADDDATE(`last link`, INTERVAL MINUTE 30) < CURTIME()

RedLineIT
10-20-2004, 05:34 AM
Hi,

thanks for your reply.

i assume i understood correctly.
i tried the following query
$oflquery = "UPDATE `userss` SET `status` = 'offline' WHERE ADDDATE(`lastclick`, INTERVAL MINUTE 30) < CURTIME()";

nothing happens .. just gives me a syntax error :(



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum