Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time difference

Status
Not open for further replies.

musalpay

Programmer
Jul 8, 2005
10
0
0
TR
<%
onlndt = now() - 0.004

onlinemembers = conn.execute("SELECT count(*) FROM members where lastlogindate > '"& onlndt &"' ORDER BY lastlogindate ")(0)

%>
I am trying to count the number of members logined last one minute or another time range. But onlinemembers always shows "0"

What should I do?

 
whatever language that is (php?) it's obviously not giving you what you want

furthermore, the ORDER BY clause is inappropriate on a COUNT(*) query

try this --
Code:
SELECT count(*) 
  FROM members 
 where lastlogindate > date_sub(now(), interval 2 minute)

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top