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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 10-01-2005, 10:12 PM   #1
daddy321
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
daddy321 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-01-2005, 10:21 PM   #2
sarettah
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!
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-01-2005, 10:35 PM   #3
Babaganoosh
♥♥♥ Likes Hugs ♥♥♥
 
Babaganoosh's Avatar
 
Industry Role:
Join Date: Nov 2001
Location: /home
Posts: 15,841
Quote:
Originally Posted by sarettah
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.
The site in your sig cracked me up.

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.
Babaganoosh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-01-2005, 11:19 PM   #4
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
Quote:
Originally Posted by Babaganoosh
The site in your sig cracked me up.
yup, lol, that site is fucking great
__________________
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
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-02-2005, 06:42 AM   #5
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,150
Thanx
__________________
All cookies cleared!
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.