You are here: Re: [PHP] Help with SQL statement « PHP « IT news, forums, messages
Re: [PHP] Help with SQL statement

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация