Visualizzazione dei risultati da 1 a 3 su 3

Discussione: Gestore News

  1. #1

    Gestore News

    Ciao! Ho fatto un gestore dinews x il mio sito!

    <?
    include("mysql.php");
    $query = mysql_query("SELECT * FROM news", $connetti);
    ?>
    <html>
    <head><title>Delex.TK</title>
    </head>
    <link href="stile.css" rel="stylesheet" type="text/css">
    <center>
    <font size="1" face="verdana">
    <?
    while ($articlerow = mysql_fetch_array($query)) {

    $titolo = $articlerow['titolo'];

    $data = $articlerow['data'];

    $testo = $articlerow['testo'];

    $autore = $articlerow['autore'];

    echo "<table width=\"97%\" border=\"1\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"stile.css\">";
    echo "<tr>";
    echo "<td><table class=\"Stile1\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
    echo "<tr>";
    echo "<td colspan=\"2\" background=\"img//bg_tb_sup.gif\"><font color=\"#FFFFFF\" size=\"0,8\">$titolo - Inserita il: $data</td>";
    echo "</tr>";
    echo "<tr>";
    echo "<td colspan=\"2\">$testo</td>";
    echo "</tr><tr>";
    echo "<td width=\"80%\"></td>";
    echo "<td width=\"20%\">by $autore</td>";
    echo "</tr></table></td></tr></table></center>
    ";
    }
    ?>



    </html>

    il priblema è che le news invece di ordinarle tipo "ultima news inserita" me le ordina il contrario..

    cme faccio a risolvere 'sta cosa?

    ciao

  2. #2
    Utente di HTML.it L'avatar di jubin
    Registrato dal
    Jan 2002
    Messaggi
    234

    Re: Gestore News

    Codice PHP:
    order by 'data' desc 
    nella query


  3. #3
    ho risolto!!!

    $query = mysql_query("SELECT * FROM news ORDER BY id DESC", $connetti);

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.