Posted by Joe (GKF) on 04/15/07 03:53
I have data arranged in weekly blocks starting on Sunday. I wanted to
use date("W") as a selector/ trigger (whatever the correct term is) but
it starts the week on MONday. I'm going around in circles trying to
solve this problem, which I am sure is not as difficult as I am making
it.
Having the site hosted on the other side of the International Date Line
isn't helping my head either...
my data base looks like fifty-two records containing
weeknum,sundaystuff, mondaystuff,...etc
and the php is
(part)
$thisweek=date("W") ;
if ($thisweek > 52) { $thisweek=1;}; /*because the year is longer than
52weeks*/
$result = mysql_query("SELECT * FROM alltext where
weekofyear='$thisweek' ")
or die("Bad query: " . mysql_error());
echo '<p>This is week ' .($thisweek) ;
while($row = mysql_fetch_array($result))
(do some stuff)etc.
Help!
--
http://graspages.cjb.cc/
[Back to original message]
|