while in for-Schleife: Counter Wert übernehmen

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • while in for-Schleife: Counter Wert übernehmen

    PHP-Code:

      $ausgabe 
    "
      <table width=50% border=1 cellspacing=0 cellpadding=0>"
    ;

      for(
    $c 1$c <= $i_dayOfMonth$c++)
      {
        while(
    $row=mysql_fetch_object($q))
        {
          
    $testvar $c;
          
    $walter .= $row->tag." / <b>".$testvar."</b>&nbsp;&nbsp;";
        }
            
        
    $ausgabe .= "
        <tr>
          <td>
    $c</td>
          <td>"
    ;

        
    $ausgabe .= $walter;

        
    $ausgabe .= "
          </td>
        </tr>"
    ;
      }

      
    $ausgabe .= "</table> "
    Hallo Forum!

    Warum ist $testvar immer 1?

    Wie bekommt $testvar den Wert von $c?
    Angehängte Dateien
    Zuletzt geändert von loper; 02.08.2006, 12:03.
    MfG,
    loper

  • #2
    Wie sieht die Var $i_dayOfMonth aus ?

    Gruss

    tobi
    Gutes Tutorial | PHP Manual | MySql Manual | PHP FAQ | Apache | Suchfunktion für eigene Seiten

    [color=red]"An error does not become truth by reason of multiplied propagation, nor does truth become error because nobody sees it."[/color]
    Mohandas Karamchand Gandhi (Mahatma Gandhi) (Source)

    Kommentar


    • #3
      > Wie sieht die Var $i_dayOfMonth aus ?

      30

      PHP-Code:
      $s_date "2006-06-15";
      $i_dayOfMonth date('t'strtotime($s_date)); 
      MfG,
      loper

      Kommentar

      Lädt...
      X