It's my first time creating a website with PHP and MySQL. How do I query the results of a Mysql search to display only the results from the last 7 days?
The columns in my database are:
Id
Name
Date
Mensage
It's my first time creating a website with PHP and MySQL. How do I query the results of a Mysql search to display only the results from the last 7 days?
The columns in my database are:
Id
Name
Date
Mensage
There's a few ways to do this. Here's one.
And another:
FYI, you should not name your columns using reserved keywords. It's a bad idea and can only cause problems for you.
Get the last 7 days date
Get the current
There is complete query example by combine two above parts
By use this query you could get data from database than execute with php mysql_query and mysql_result function