Visualizzazione dei risultati da 1 a 3 su 3

Discussione: Errore codice

  1. #1
    Utente di HTML.it
    Registrato dal
    Apr 2006
    Messaggi
    38

    Errore codice

    http://www.games-mafia.com/dal_forum.php

    Salve a tutti ho questo problema come potete vedere nel link, come mai?

    <?php
    $host = "localhost"; // indirizzo IP del server Mysql
    $user = "mio user"; // tuo username
    $pass = "mia pass"; // tua pass
    $database = "mio db"; // nome database
    $ultimi_post = "7"; // quanti post vuoi vedere


    $connessione = mysql_connect($host, $user, $pass) or die("Non riesco a connettermi al DB");
    mysql_select_db($database, $connessione) or die("Non riesco a selezionare il database");
    $query = "SELECT tid,title,start_date,starter_id,starter_name FROM ibf_topics ORDER BY last_post DESC LIMIT 0,".$ultimi_post;



    $risultato = mysql_query($query);
    while ($riga = mysql_fetch_assoc($risultato))
    {$data = date("j/n/Y", $riga['start_date']);

    if (strlen($riga['title'])>=6) {
    $riga['title']= substr($riga['title'],0,5)."..";

    }
    echo "<a href=\"forum/index.php?showtopic={$riga['tid']}\" target=\"_top\">{$riga['title']}</a> <font face=\"verdana\" size=\"-2\">di {$riga['starter_name']} - $data</font>
    \n";

    }
    mysql_free_result($risultato);
    mysql_close($connessione);
    ?>

  2. #2

    Re: Errore codice

    Originariamente inviato da Chaos20
    http://www.games-mafia.com/dal_forum.php

    Salve a tutti ho questo problema come potete vedere nel link, come mai?

    <?php
    $host = "localhost"; // indirizzo IP del server Mysql
    $user = "mio user"; // tuo username
    $pass = "mia pass"; // tua pass
    $database = "mio db"; // nome database
    $ultimi_post = "7"; // quanti post vuoi vedere


    $connessione = mysql_connect($host, $user, $pass) or die("Non riesco a connettermi al DB");
    mysql_select_db($database, $connessione) or die("Non riesco a selezionare il database");
    $query = "SELECT tid,title,start_date,starter_id,starter_name FROM ibf_topics ORDER BY last_post DESC LIMIT 0,".$ultimi_post;



    $risultato = mysql_query($query);
    while ($riga = mysql_fetch_assoc($risultato))
    {$data = date("j/n/Y", $riga['start_date']);

    if (strlen($riga['title'])>=6) {
    $riga['title']= substr($riga['title'],0,5)."..";

    }
    echo "<a href=\"forum/index.php?showtopic={$riga['tid']}\" target=\"_top\">{$riga['title']}</a> <font face=\"verdana\" size=\"-2\">di {$riga['starter_name']} - $data</font>
    \n";

    }
    mysql_free_result($risultato);
    mysql_close($connessione);
    ?>
    la parentesi graffa?

  3. #3
    Utente di HTML.it
    Registrato dal
    Apr 2006
    Messaggi
    38
    potete chiudere risolto.

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.