Unable to SQL => Getting content of last 7 days
Using DATE_ADD() or DATE_SUB()

SELECT * FROM Table_Name
WHERE connect_time &gt;= DATE_ADD(CURDATE(),INTERVAL -7 DAY);


or

SELECT * FROM Table_Name
WHERE connect_time &gt;= DATE_SUB(CURDATE(),INTERVAL 7 DAY);


Without those functions, you can also do

SELECT * FROM Table_Name
WHERE connect_time &gt;= (CURDATE() + INTERVAL -7 DAY);


or

SELECT * FROM Table_Name
WHERE connect_time &gt;= (CURDATE() - INTERVAL 7 DAY);