I need to do something like:
For y = iBeginDay to iEndDay
Next
How would I do this in .php?
Many thanks!
Looping help
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
for ($y = $iBeginDay; $y <= $iEndDay; $y++)
{
;
}Thanks. That has been what I have been doing.
When I plug in dates...my loop gets locked up..Both dates are stored as a DATE in mysql.
Any thoughts?[/url]
When I plug in dates...my loop gets locked up..Both dates are stored as a DATE in mysql.
Code: Select all
forr ($y = $myrow['sdate']; $y <= $myrow['edate']; $y++)
{
echo "here" .$y;
}- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
ignoring "forr," iteration over date values is more easily accomplished via strtotime().
Why do you wish to iterate the dates?
Why do you wish to iterate the dates?