date(W) difficulty

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/
joedinmore [ So, 15 April 2007 05:53 ] [ ID #1688251 ]
PHP » alt.php » date(W) difficulty

Vorheriges Thema: PHP & Paypal solution to sell digital goods?
Nächstes Thema: Checkstate of Radiobutton