Hi,
I want in a table called week_year with following schema:
Week_year = {id, week, year}
To insert the weeks for each year, such that, for 2001 there is week 1, week 2, week 3, … , week 52, and then start over for year 2002 up until the year 2009.
I’ve tried different PHP scripts but can’t seem to be getting it right. I’ve tried different tables, one for year and one for week and then give each week a year_id, but that didn’t seem to be effective.
I’m hoping that someone can help me create, what I believe is a simple PHP loop(s) to generate these numbers and insert them into my MySQL database.
Added additional Information posted as an answer
I've tried this code, which is a endless loop of the year:
<?php
$year = 2001;
$week_start = 1;
$week_end = 52;
for ( $week_start = 1; $week_start <= 52; $week_start++ ) {
echo $week_start;
echo "<br />";
for ($week_start = 1; $week_start <= 52; $year++) {
echo $year;
echo "<br />";
}
}
?>