|
|
|
||||
|
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
Registered User
Join Date: Jul 2005
Posts: 22
|
SQL question
Guys, I need some help here.
I am trying to find out today's singups. But, seems to me below statements give me last 24hour. I just wanna know how to get correct result for the current day. Today's Signups: SELECT COUNT(ID) FROM `Members` WHERE Status = 'Active' AND (TO_DAYS(NOW()) - TO_DAYS(registration)) <= 1; SELECT COUNT(ID) FROM `Members` WHERE Status = 'Active' AND DATE_SUB(CURDATE(),INTERVAL 1 DAY) <= registration; is this also correct way to find out logins for the current day, not last 24 hours? Last 1 day's login SELECT COUNT(ID) FROM `Members` WHERE Status = 'Active' AND (TO_DAYS(NOW()) - TO_DAYS(lastlogin)) <= 1; Big thanks Daddy |
|
|
|
|
|
#2 |
|
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,150
|
If the data is stored as a regular datetime field then:
SELECT COUNT(ID) FROM `Members` WHERE Status = 'Active' AND date_format(registration, '%m-%d-%y') ='10-01-05' Should get you all the registrations for October 1.
__________________
All cookies cleared! |
|
|
|
|
|
#3 | |
|
♥♥♥ Likes Hugs ♥♥♥
Industry Role:
Join Date: Nov 2001
Location: /home
Posts: 15,841
|
Quote:
Good stuff. If I weren't a programmer myself I would hire you for everything. I am not a fucking designer however so I might hit you up still.
__________________
I like pie. |
|
|
|
|
|
|
#4 | |
|
<&(©¿©)&>
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
|
Quote:
![]()
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000 Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager ![]() Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager |
|
|
|
|
|
|
#5 |
|
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,150
|
Thanx
__________________
All cookies cleared! |
|
|
|