Re: Help with SQL statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2005-02-17 at 23:21, Jacques wrote:
> How can I determine which users have signed in and are still on-line during 
> the first minute after they have signed in? My sql statement currently 
> reads:
> 
> SELECT * FROM tblusers WHERE usignedin = "yes" AND utimesignedin = (time() - 
> 60)
> 
> Hoe does one indicate seconds in a SQL statement? Can I use the time() 
> function or should I use the now() function rather?
> 
> Thanks
> Jacques 

I almost do not know where to begin.

What database are you using?  The functions you need to be looking at
are going to be executed by the dbms not php.  Look in the dbms docs for
the time functions available.  Are you really interested in users who
logged in exactly 60 seconds ago ( you are using = afterall )?

if course this also depends on what type of data is stored in
utimesignedin if it is a timestamp with the resolution in seconds then
you should be good to go with the
whatever_database_function_returns_the_current_timestamp() - 60 deal.

Bret

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux