Dear PHP friends,
I have a calendar from the current month:
[php]
$vandaag = time();
$dag = date(“d”, $vandaag);
$maand = date(“m”, $vandaag);
$jaar = date(“Y”, $vandaag);
$begindag = mktime(0,0,0,$maand, 1, $jaar);
$maandnaam = date(‘m’, $begindag);
if($maandnaam == ‘01’){ $maandnaam = ‘Januari’; }
if($maandnaam == ‘02’){ $maandnaam = ‘Februari’; }
if($maandnaam == ‘03’){ $maandnaam = ‘Maart’; }
if($maandnaam == ‘04’){ $maandnaam = ‘April’; }
if($maandnaam == ‘05’){ $maandnaam = ‘Mei’; }
if($maandnaam == ‘06’){ $maandnaam = ‘Juni’; }
if($maandnaam == ‘07’){ $maandnaam = ‘Juli’; }
if($maandnaam == ‘08’){ $maandnaam = ‘Augustus’; }
if($maandnaam == ‘09’){ $maandnaam = ‘September’; }
if($maandnaam == ‘10’){ $maandnaam = ‘Oktober’; }
if($maandnaam == ‘11’){ $maandnaam = ‘November’; }
if($maandnaam == ‘12’){ $maandnaam = ‘December’; }
'.$maandnaam.' '.$jaar.' |
Zo: | Ma: | Di: | Wo: | Do: | Vr: | Za: |
’; | ’.$dagen.’ | ’;|||||
’; |
Using a MySQL database I retrieve events, check out query below:
[php]
$query = “select day(datum) as dag, type from planning where
month(datum)= ‘$maand’ and
year(datum) = ‘$jaar’ and
type != ‘Overgeslagen bezoek’”;
$result = mysql_query($query)or die (“Query probleem”);
while($row = mysql_fetch_assoc($result)){
extract($row);
echo $dag;
}
[/php]
This gives result like 2 and 25.
How can I give thoses days from my database, a color into $dagen++
I only get weird result and infinite loops…
Thanks in advance
Treid Google, not my friend today.