Hello. The site has the functionality of displaying registered users for TODAY, you still need to implement "yesterday."

How to do?

Today use this request

$command = "SELECT COUNT(uid) FROM users WHERE date>UNIX_TIMESTAMP(CURDATE())"; 

    1 answer 1

     $command = "SELECT COUNT(uid) FROM users WHERE date BETWEEN UNIX_TIMESTAMP(SUBDATE(CURDATE(), 1) AND UNIX_TIMESTAMP(CURDATE())"; 
    • Does not work. In the field with users there is a table "date" here you have to make a start from it. - Igor
    • someone tell me? how to implement correctly? - Igor
    • in the field "date" has this type 1475669409 - Igor
    • SELECT COUNT (uid) FROM users WHERE date BETWEEN UNIX_TIMESTAMP (CURDATE () - interval 1 day) AND UNIX_TIMESTAMP (CURDATE ()); - Igor
    • Here is the right decision - Igor