![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 | |
Confirmed User
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,123
|
![]() I have this code, which lets me pull records from the 'created' column for todays date & time:
Quote:
Just to complicate it a little, Id like it to pull based on the month, so whether a recipe was added last year, 10 years ago, etc it'll still display the data as described below. Basically, I'm wanting a pseudo page on my recipe site that gives visitors a list of 30 recipes for breakfast, lunch and dinner (that are recent additions) which will change every day, cycling through the last 90 recipe additions (per category)s, sort of like how the old POTD pages used to work. TIA for any help.
__________________
SOMETHING EXTREME IS COMING SOON! |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,058
|
select * from table
where created >=DATE_SUB(current_date(), INTERVAL 30 DAY) order by created desc That will stack all records created in the past 30 days in descending order so that the newest records are at the top of the pile. .
__________________
All cookies cleared! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
So Fucking Banned
Industry Role:
Join Date: Nov 2008
Location: with your dream girl
Posts: 4,941
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 | |
Confirmed User
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,123
|
Quote:
![]() I assume if I wanted to add a longer date I just change the '30'? Like, INTERVAL 30 DAY isnt a set parameter in php?
__________________
SOMETHING EXTREME IS COMING SOON! |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,123
|
__________________
SOMETHING EXTREME IS COMING SOON! |
![]() |
![]() ![]() ![]() ![]() ![]() |