liamloveslearning Posted June 28, 2010 Share Posted June 28, 2010 Hi all, I have a photo gallery, in my showcase I want to show only photos uploaded this week, Im currently filtering my command using BETWEEN $mystartdate AND $myenddate <?php $startdate = date('Y-m-d', strtotime ("last Sunday")); $enddate = date('Y-m-d', strtotime ("next Saturday")); ?> Only when it comes to sunday it shows all photos makred to show in the future, if this makes sense? How can i filter this to say show all photos between last sunday and the sunday coming? or if its currently a sunday, show all photos uploaded between last sunday and today? Quote Link to comment Share on other sites More sharing options...
liamloveslearning Posted June 28, 2010 Author Share Posted June 28, 2010 I think this works... <?php $startdate = date('Y-m-d', strtotime ("last Sunday")); $enddate = date('Y-m-d', strtotime("now")); ?> Quote Link to comment Share on other sites More sharing options...
Alex Posted June 28, 2010 Share Posted June 28, 2010 $enddate = date('Y-m-d', strtotime("now")); Would be the same as.. $enddate = date('Y-m-d'); Quote Link to comment Share on other sites More sharing options...
salathe Posted June 28, 2010 Share Posted June 28, 2010 Maybe I'm misunderstanding, but don't you always want the photos between last Sunday and today? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.