Reply to date(W) difficulty

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация