Posted by Bret Hughes on 02/18/05 20:21
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
Navigation:
[Reply to this message]
|