Kopfzeile in der Ausgabe wiederholen.

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

  • Kopfzeile in der Ausgabe wiederholen.

    Hey Leute, ich habe ein Problem mit der Wiederholung der Tabellenkopfzeile.

    Wie ihr im Code sieht habe ich eine for schleife für die Ausgabe der Tabelle benötigt.

    Ich habe schon vieles versucht, vor allem Schleifen zu verschachteln.
    Bin dabei aber auf Granit gestossen


    Kann mir jemand weiterhelfen?

    Danke zum Voraus!!

    PHP-Code:
    <?PHP
    //Ausgabeschleife 

    for($i=0$i $num_soft$i++)
    {

    mysql_data_seek ($result$i);
    $soft mysql_fetch_array($result);

    echo 
    "<tr>";
    echo 
    "<td>$soft[S_Name]</td>";
    echo 
    "<td>$soft[Version]</td>";
    echo 
    "<td>$soft[P_Name]</td>";
    echo 
    "<td>$soft[K_Name]</td>";
    echo 
    "<td>$soft[He_Name]</td>";
    echo 
    "<td>$soft[Anz_Installationen]</td>";
    echo 
    "<td>$soft[Anz_Lizenzen]</td>";
    echo 
    "<td>$soft[S_ID]</td>";
    echo 
    "</tr>";

    }
    PHP?>

  • #2
    PHP-Code:
    <?PHP
    //Ausgabeschleife 
    mysql_data_seek ($result$i);

    while(
    $soft mysql_fetch_array($result))
    {

    echo 
    "<tr>";
    echo 
    "<td>$soft['S_Name']</td>";
    echo 
    "<td>$soft['Version']</td>";
    echo 
    "<td>$soft['P_Name']</td>";
    echo 
    "<td>$soft['K_Name']</td>";
    echo 
    "<td>$soft['He_Name']</td>";
    echo 
    "<td>$soft['Anz_Installationen']</td>";
    echo 
    "<td>$soft['Anz_Lizenzen']</td>";
    echo 
    "<td>$soft['S_ID']</td>";
    echo 
    "</tr>";

    }
    ?>
    oder

    PHP-Code:
    <?PHP
    //Ausgabeschleife 
    mysql_data_seek ($result$i);
    $soft mysql_fetch_array($result);
    for(
    $i 1$i $num_soft$i++)
    {

    echo 
    "<tr>";
    echo 
    "<td>$soft['S_Name']</td>";
    echo 
    "<td>$soft['Version']</td>";
    echo 
    "<td>$soft['P_Name']</td>";
    echo 
    "<td>$soft['K_Name']</td>";
    echo 
    "<td>$soft['He_Name']</td>";
    echo 
    "<td>$soft['Anz_Installationen']</td>";
    echo 
    "<td>$soft['Anz_Lizenzen']</td>";
    echo 
    "<td>$soft['S_ID']</td>";
    echo 
    "</tr>";

    }
    ?>
    hinweis:
    <?php
    // blaa
    ?>

    und nicht
    <?php
    // blaa
    php?>
    Zuletzt geändert von Benny-one; 17.12.2003, 11:46.
    Sunshine CMS
    BannerAdManagement
    Borlabs - because we make IT easier
    Formulargenerator [color=red]Neu![/color]
    Herkunftsstatistik [color=red]Neu![/color]

    Kommentar


    • #3
      PHP-Code:
      // arrays im string schreibt man so
      echo "<td>".$soft['S_Name']."</td>";

      // oder
      echo "<td>{$soft[S_Name]}</td>"
      ersteres ist aber besser.
      INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


      Kommentar


      • #4
        Original geschrieben von Abraxax
        PHP-Code:
        echo "<td>{$soft[S_Name]}</td>"
        ersteres ist aber besser.
        du meist mein while??

        ach ja: verzieh dich!! will nützlich sein!
        Sunshine CMS
        BannerAdManagement
        Borlabs - because we make IT easier
        Formulargenerator [color=red]Neu![/color]
        Herkunftsstatistik [color=red]Neu![/color]

        Kommentar


        • #5
          Original geschrieben von Benny-one
          verzieh dich!!
          ich glaube wahsaga hatte dich gewarnt! 3 tage ban!
          h.a.n.d.
          Schmalle

          http://impressed.by
          http://blog.schmalenberger.it



          Wichtige Anmerkung: Ich habe keine Probleme mit Alkohol ...
          ... nur ohne :-)

          Kommentar


          • #6
            Vielen Dank für die schnelle Hilfe und für die Tipps!

            Aber mein Problem ist immernoch:

            Irgendwie diese Tabellenkopfzeile z.B. jede zehnten datensatz zu wiederholen.


            PHP-Code:
            <?PHP
            echo "<table border='5' cellspacing='5' cellpadding='5' align='center'>";
            echo 
            "<caption><b><big>AllSoft_S1</big></caption></b>";
            echo 
            "<tr>";
            echo 
            "<td><b><a href='http://192.168.17.112/inventar/ok/formulare.php'>Back</a></td></tr></b>";
            echo 
            "<tr>";
            echo 
            "<td><b>Software</b></td>";
            echo 
            "<td><b>Version</b></td>";
            echo 
            "<td><b>Plattform</b></td>";
            echo 
            "<td><b>Kategorie</b></td>";
            echo 
            "<td><b>Hersteller</b></td>";
            echo 
            "<td><b>Anz_Installationen</b></td>";
            echo 
            "<td><b>Anz_Lizenzen</b></td>";
            echo 
            "<td><b>Archivnr.</b></td>";
            echo 
            "</tr>";
            ?>
            Zuletzt geändert von Dr.Stone; 17.12.2003, 12:37.

            Kommentar


            • #7
              In der for-Schleife noch das nach dem </tr> einfügen:
              PHP-Code:
              $hilfsvariable++;
              if (
              $hilfsvariable == 10)
              {
              // Ausgabe Tabellenkopf (Also das was du shconmal geschrieben hast hier nochmal schreiben)
              $hilfsvariable 0;

              it's not a bug,
              it's a feature!

              Kommentar


              • #8
                Hey!!!

                Das ist die Lösung!

                Ich danke dir viel viel vielmals!

                Mein Held!!

                Kommentar


                • #9
                  Bitte bitte! Dafür binnich ja da!
                  it's not a bug,
                  it's a feature!

                  Kommentar

                  Lädt...
                  X