|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Hey all,
Im new to this forum so Im unsure if this is meant for here or what ![]() I want to make a search feature, but want to make a "only show articles from 5 days ago" part. How would i go about doing this in mysql? i have 4.1 and the field is DateListed. For example: I want to parse through a number, and take that number from the current date and search the database for anything beween then and now. Sorry i havnt explained it well.. hehe Thankyou very much. -Christian |
|
#2
|
||||
|
||||
|
Try something along the lines of:
Code:
SELECT * FROM table WHERE DATEDIFF(datefield, NOW()) < 5 |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > Search x amount of days from listed date |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|