I came on here to ask pretty much the same question. Maybe we can help eachother.
What I have done so far (doesnt work) is pass in a date variable, formatted yyyy-mm-dd. (for now it is just a string, but it WOULD be passed in [as a string])
Then right before my query i have this code:
$Date="2009-05-01"
$year = substr($Date,0,4);
$month = substr($Date,5,2);
$day =substr($Date,8,2);
$dateMK = mktime(0,0,0,date($month),date($day)+7,date($year));
while($date < $dateMK){
do query
$day = date($day)+1;
$dateMK = mktime(0,0,0,date($month),date($day),date($year));
}
My problem is just that I dont know how to grab the info from the query. I will wait to see if someone answers your question, then see if I can use that. else just start my own topic 🙂
Maybe you can figure out how to fix your problem using my code. (ps. I am not sure if the way I incremented it at the bottom of the while loop is correct)
Hope this helps!
Paul