[PHP] Get Rows From Same Day From Column

Berk

berkibap#4233
Developer
Oct 17, 2015
863
190
Hey,
it's been a long time since I posted here and now I'm back,
I'm wondering, how can I get like today registered users from database, time is stored at account_created column.
I don't really know how to do this so I could not try, forgive me.

Thanks.
 

MayoMayn

BestDev
Oct 18, 2016
1,423
683
What format is it stored in? TIMESTAMP? UNIX_TIMESTAMP? DATE?
Next time provide a bit more sufficient information so it'd be easier to help you out, all we practically can do atm is guessing :p

 

MayoMayn

BestDev
Oct 18, 2016
1,423
683
This should do it.

Code:
SELECT * FROM tableName WHERE account_created >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 1 DAY))

 

Users who are viewing this thread

Top