Neue Datensätze makieren

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

  • Neue Datensätze makieren

    PHP-Code:
    SELECT k.kat_id k_kat_idk.kat_name k_kat_namel.link_id l_link_id,
     
    l.link_katid l_link_katidl.link_url l_link_urll.link_klicks l_link_klicks
    FROM gothic_kat k
    INNER JOIN gothic_links l
    ON k
    .kat_id l.link_katid
    ORDER BY k
    .kat_namel.link_url 
    PHP-Code:
    $last "";
    if ( 
    $res mysql_query($stat) ) {
           while ( 
    $row mysql_fetch_object($res) ) {
               if ( 
    $row->k_kat_id != $last ) {
                   echo 
    $row->k_kat_name;
                   
    $last $row->k_kat_id;
               }
            echo 
    $row->l_link_url//hier sollte dann das "new" mitausgegeben werden
           
    }
        
    mysql_free_result($res);

    nun würde ich gerne die letzten 10 IDs (l_link_id) mit einem "new" makieren.....

    leider funktionieren meine versuche nicht.... auch das sql statement um ein COUNT zu erweitern und damit weiter zu arbeiten funktioniert irgendie nicht

    wäre super wenn mir jemand helfen könnte
    the end comes faster than you think - you've already reached it!

  • #2
    pseudocode:

    zähler = anzahl_datensätze
    while()
    {
    if(zähler <= 10)
    echo 'neu'
    zähler--;
    }
    Kissolino.com

    Kommentar


    • #3
      ja nur wie bekomm ich anzahl_datensätze

      PHP-Code:
      SELECT k.kat_id k_kat_idk.kat_name k_kat_namel.link_id l_link_id,
       
      l.link_katid l_link_katidl.link_url l_link_urll.link_klicks l_link_klicks
      COUNT(l.link_id) AS anzahl_datensaetze FROM gothic_kat k
      INNER  JOIN gothic_links l ON k
      .kat_id l.link_katid GROUP BY k.kat_id ORDER  BY k.kat_namel.link_url 
      Das GROUP muss ich machen weil sonst das COUNT nicht will

      #1140 - Das Vermischen von GROUP Spalten (MIN(),MAX(),COUNT()...) mit Nicht-GROUP Spalten ist nicht erlaubt, sofern keine GROUP BY Klausel vorhanden ist.

      wenn ich das GROUP so lasse dann hab ich für jede Kategorie die anzahl_datensaetze, (und bei der ausgabe hab ich dann nur noch einen datensatz) ich brauch aber die von allen kategorien zusammen
      Zuletzt geändert von JOat; 21.07.2004, 14:52.
      the end comes faster than you think - you've already reached it!

      Kommentar


      • #4
        Original geschrieben von JOat
        ja nur wie bekomm ich anzahl_datensätze
        mysql_num_rows()
        I don't believe in rebirth. Actually, I never did in my whole lives.

        Kommentar


        • #5
          gggggggrrrrrrrrrrrrrrrrrrrrrrrrrrrr......... ich bin so dumm

          da hätt ich auch drauf kommen können......



          DANKE
          the end comes faster than you think - you've already reached it!

          Kommentar

          Lädt...
          X