xpfreund: Resultset erzeugen

Beitrag lesen

Hallo,

Was ist bitte jetzt noch falsch?
<code>
$now_date = date("Y-m-d", mktime(date("H")+$timezone,date("i"),date("s"),date("m"),date("d"),date("Y")));
for ($d=1; $d <= date("t", mktime(0,0,0,($month+1),0,$year)); $d++) {
  // fetch events
  $datum2 = date("Y-m-d",mktime(0,0,0,$month,$d,$year));
  $result3 = db_query("select ID
                         from ".DB_PREFIX."termine
                       where datum like '$datum2' and an=$user_ID") or db_die();
  $row3 = db_fetch_row($result3);
  // today = red
  if ($now_date == $datum2) {$da = "<div style='color:red; background-color:$terminfarbe; font-weight:bold;'>".$d."&nbsp;</div>";}
  // days with events = black
  elseif ($row3[0] > 0 and !$view) {$da = "<div style='color:black; font-weight:bold;'>".$d."&nbsp;</div>";}
  // weekend
  elseif (date('w', mktime(0,0,0,$month,$d,$year)) == 0 || date('w', mktime(0,0,0,$month,$d,$year)) == 6) {
  $da = "<div style='font-weight:900; color:".$weekend_color.";'>".$d."&nbsp;</div>";}
  // holidays
  else {select an, datum, event, if(event='Urlaub','$holidays_color','blue') as farbe
</code>
Unexpected T_String ab else
<code>
from termine
  where (an = $an) and (datum = '$year-$month-$d');
  if ($farbe == $holidays_color)  {
  $da = "<div style='font-weight:900; color:".$holidays_color.";'>".$d."&nbsp;</div>";}
  // normal day = blue
  else { $da = $d."&nbsp;"; }

// day link
  echo "<td id=ri><a href="javascript:dayweek(1, $year, $month, $d, '$sid')">$da</a></td>\n";
  if (date("w", mktime(0,0,0,$month,$d,$year)) == 0 and date("t", mktime(0,0,0,($month+1),0,$year)) > $d )  {
    echo "</tr><tr>\n";
    // set values to show week number
    $da = $d + 1;
    $week_nr = get_week_nr($da);
    echo "<td>&nbsp;</td><td id=ri bgcolor=$bgcolor3><i><a href="javascript:dayweek(2, $year, $month, $da, '$sid')">$week_nr</a></i>&nbsp;&nbsp;</td>\n";

}
}
</code>
"from termine" ist in einer neuen Zeile, oder fehlt da nur irgendwo ein Semikolon?
Sagt jetzt nicht, der Datenbankzugriff in der Schleife, außer ihr wisst, wie man das besser machen kann.

gruß aus Hosena