Pagina 1 di 3 1 2 3 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 26

Discussione: solo un paio di record

  1. #1
    Utente di HTML.it
    Registrato dal
    Jan 2005
    Messaggi
    579

    solo un paio di record

    <?php
    # Includo il file di configurazione
    require("config.php");

    # Recupero i forum esistenti
    $query = mysql_query("SELECT * FROM mioforum
    ORDER BY titolo ASC");

    # Stampo il percorso
    echo "Main";

    # Stampo la lista di tutti i Forum
    while($result = mysql_fetch_array($query))
    {
    echo "[*]<a href=\"forum.php?f=$result[id]\">";
    echo "$result[titolo]</a>";
    }

    include ('qualsiasi.php');
    ?>


    con questo mi compaiono tutti i titoli inseriti nella tabella
    mentre se io volessi estrarne uno o più titoli, così per nn estrali tutti,
    cosa dovrei inserire come codice????

    grazie
    l'uomo è tutto ciò che non può essere

    http://www.ebug.it Discussioni da web Designer

    http://www.ebug.it/?p=354 e Dart Fener dove lo mettiamo lol

  2. #2
    $query = mysql_query("SELECT * FROM mioforum
    ORDER BY titolo ASC LIMIT X"

    dove X + il numero di record che vuoi


  3. #3
    Utente di HTML.it
    Registrato dal
    Jan 2005
    Messaggi
    579
    codice:
    <html>
    
    <head>
    <meta http-equiv="Content-Language" content="it">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>Nuova pagina 1</title>
    </head>
    
    <body>
    
    <div align="center">
      <center>
      <table border="1" width="657" height="663">
        <tr>
          <td width="657" height="98" colspan="2"><? include ('banner.jpg'); ?></td>
        </tr>
        <tr>
          <td width="657" height="68" colspan="2"><? include ('menu.php'); ?></td>
        </tr>
        <tr>
          <td width="657" height="19" colspan="2"><? include ('tti.php'); ?></td>
        </tr>
        <tr>
          <td width="32" height="24"></td>
          <td width="609" height="30">Scacchi</td>
        </tr>
        <tr>
          <td width="32" height="99" rowspan="4"></td>
          <td width="609" height="6"><?php 
    # Includo il file di configurazione 
    require("config.php"); 
    
    # Recupero i forum esistenti 
    $query = mysql_query("SELECT * forum
    ORDER BY Didattica ASC ");  
    
    # Stampo la lista di tutti i Forum 
    while($result = mysql_fetch_array($query)) 
    { 
    echo "
      </table>[*]<a href=\"forum.php?f=$result[id]\">"; 
    echo "$result[titolo]</a>"; 
    } 
     
    ?>
        <table>
        <tr>
          <td width="609" height="9"><?php 
    # Includo il file di configurazione 
    require("config.php"); 
    
    # Recupero i forum esistenti 
    $query = mysql_query("SELECT * Forum
    ORDER BY Libri ASC ");  
    
    # Stampo la lista di tutti i Forum 
    while($result = mysql_fetch_array($query)) 
    { 
    echo "
        </table>[*]<a href=\"forum.php?f=$result[id]\">"; 
    echo "$result[titolo]</a>"; 
    } 
    
    ?>
        <table>
        <tr>
          <td width="609" height="9"><?php 
    # Includo il file di configurazione 
    require("config.php"); 
    
    # Recupero i forum esistenti 
    $query = mysql_query("SELECT * Forum
    ORDER BY Tatticismi ASC ");  
    
    # Stampo la lista di tutti i Forum 
    while($result = mysql_fetch_array($query)) 
    { 
    echo "
        </table>[*]<a href=\"forum.php?f=$result[id]\">"; 
    echo "$result[titolo]</a>"; 
    } 
    
    ?>
        <table>
        <tr>
          <td width="609" height="27"><?php 
    # Includo il file di configurazione 
    require("config.php"); 
    
    # Recupero i forum esistenti 
    $query = mysql_query("SELECT * Forum
    ORDER BY Tornei ASC ");  
    
    # Stampo la lista di tutti i Forum 
    while($result = mysql_fetch_array($query)) 
    { 
    echo "
        </table>[*]<a href=\"forum.php?f=$result[id]\">"; 
    echo "$result[titolo]</a>"; 
    } 
    
    ?>
        <table>
        <tr>
          <td width="32" height="32"></td>
          <td width="609" height="28">Supporto</td>
        </tr>
        <tr>
          <td width="32" height="31"></td>
          <td width="609" height="23"><?php 
    # Includo il file di configurazione 
    require("config.php"); 
    
    # Recupero i forum esistenti 
    $query = mysql_query("SELECT * Forum
    ORDER BY Chiedi_a_scacchirako ASC ");  
    
    
    # Stampo la lista di tutti i Forum 
    while($result = mysql_fetch_array($query)) 
    { 
    echo "
        </table>[*]<a href=\"forum.php?f=$result[id]\">"; 
    echo "$result[titolo]</a>"; 
    } 
    
    ?>
        <table>
        <tr>
          <td width="32" height="19"></td>
          <td width="609" height="14">Programmazione &amp; grafica</td>
        </tr>
        <tr>
          <td width="32" height="69" rowspan="3"></td>
          <td width="609" height="11"><?php 
    # Includo il file di configurazione 
    require("config.php"); 
    
    # Recupero i forum esistenti 
    $query = mysql_query("SELECT * Forum
    ORDER BY html,_java,_xml ASC ");
    
    
    # Stampo la lista di tutti i Forum 
    while($result = mysql_fetch_array($query)) 
    { 
    echo "
        </table>[*]<a href=\"forum.php?f=$result[id]\">"; 
    echo "$result[titolo]</a>"; 
    } 
    
    ?>
        <table>
        <tr>
          <td width="609" height="11"><?php 
    # Includo il file di configurazione 
    require("config.php"); 
    
    # Recupero i forum esistenti 
    $query = mysql_query("SELECT * Forum
    ORDER BY Asp,_Php,_Mysql ASC ");  
    
    
    # Stampo la lista di tutti i Forum 
    while($result = mysql_fetch_array($query)) 
    { 
    echo "
        </table>[*]<a href=\"forum.php?f=$result[id]\">"; 
    echo "$result[titolo]</a>"; 
    } 
    
    ?>
        <table>
        <tr>
          <td width="609" height="17"><?php 
    # Includo il file di configurazione 
    require("config.php"); 
    
    # Recupero i forum esistenti 
    $query = mysql_query("SELECT * Forum 
    ORDER BY Flash ASC ");
    
    
    # Stampo la lista di tutti i Forum 
    while($result = mysql_fetch_array($query)) 
    { 
    echo "
        </table>[*]<a href=\"forum.php?f=$result[id]\">"; 
    echo "$result[titolo]</a>"; 
    } 
    
    ?>
        <table>
        <tr>
          <td width="32" height="34"></td>
          <td width="609" height="34">Off- topic</td>
        </tr>
        <tr>
          <td width="32" height="117" rowspan="4"></td>
          <td width="609" height="14"><?php 
    # Includo il file di configurazione 
    require("config.php"); 
    
    # Recupero i forum esistenti 
    $query = mysql_query("SELECT * Forum
    ORDER BY Agorà ASC ");  
    
    
    # Stampo la lista di tutti i Forum 
    while($result = mysql_fetch_array($query)) 
    { 
    echo "
        </table>[*]<a href=\"forum.php?f=$result[id]\">"; 
    echo "$result[titolo]</a>"; 
    } 
    
    ?>
        <table>
        <tr>
          <td width="609" height="21"><?php 
    # Includo il file di configurazione 
    require("config.php"); 
    
    # Recupero i forum esistenti 
    $query = mysql_query("SELECT * Forum
    ORDER BY Now ASC ");  
     
    
    # Stampo la lista di tutti i Forum 
    while($result = mysql_fetch_array($query)) 
    { 
    echo "
        </table>[*]<a href=\"forum.php?f=$result[id]\">"; 
    echo "$result[titolo]</a>"; 
    } 
    
    ?>
        <table>
        <tr>
          <td width="609" height="26"><?php 
    # Includo il file di configurazione 
    require("config.php"); 
    
    # Recupero i forum esistenti 
    $query = mysql_query("SELECT * Forum 
    ORDER BY Annunci ASC ");  
    
    # Stampo la lista di tutti i Forum 
    while($result = mysql_fetch_array($query)) 
    { 
    echo "
        </table>[*]<a href=\"forum.php?f=$result[id]\">"; 
    echo "$result[titolo]</a>"; 
    } 
    
    ?>
        <table>
        <tr>
          <td width="609" height="23"><?php 
    # Includo il file di configurazione 
    require("config.php"); 
    
    # Recupero i forum esistenti 
    $query = mysql_query("SELECT * Forum
    ORDER BY New_tecnologi ASC ");  
    
    
    # Stampo la lista di tutti i Forum 
    while($result = mysql_fetch_array($query)) 
    { 
    echo "
        </table>[*]<a href=\"forum.php?f=$result[id]\">"; 
    echo "$result[titolo]</a>"; 
    } 
    
    ?>
      </center>
    </div>
    <hr>
    <p align="center"><? include ('codice.txt'); ?></p>
    
    </body>
    
    </html>
    tutto questo codice ma alla fine nn mi compare niente
    come è possibile???
    grazie
    l'uomo è tutto ciò che non può essere

    http://www.ebug.it Discussioni da web Designer

    http://www.ebug.it/?p=354 e Dart Fener dove lo mettiamo lol

  4. #4
    ti aspetti che faccia da parser umano? ottò:

    fai delle prove.. metti la stampa di alcuni valori qua e la.. così capisci da solo cosa non va ^_^

    Se si tratta di query porvale magari in phpmyadmin.. o cmq mettici un bel mysql_error() quando ti danno errore così ti dice qualcosa in più sull'errore


  5. #5
    Utente di HTML.it
    Registrato dal
    Jan 2005
    Messaggi
    579
    ma va tutto bene, l'unico problema che mi crea è che nn compaiono i link del mini forum.
    ora suppongo forse che la query della richiesta forum nn sia esatta:

    tabella ===> titolo ===> miniforum

    quando invece la query chiede solamente tabella, mini forum, e allora la mi sorge un dubbio

    questa query:
    Codice PHP:
    $query mysql_query("SELECT * Forum
    ORDER BY New_tecnologi ASC "
    ); 
    nn sia esatta???

    cioè vorrei la query giusta

    grazie
    ciao

    ps: for }gu|do[z]{®© nn sono così pazzo da chiedere così tanto ciao
    l'uomo è tutto ciò che non può essere

    http://www.ebug.it Discussioni da web Designer

    http://www.ebug.it/?p=354 e Dart Fener dove lo mettiamo lol

  6. #6
    Utente di HTML.it
    Registrato dal
    Jan 2005
    Messaggi
    579
    c'è qualkuno ke può aiutarmi
    grazie
    ciao
    l'uomo è tutto ciò che non può essere

    http://www.ebug.it Discussioni da web Designer

    http://www.ebug.it/?p=354 e Dart Fener dove lo mettiamo lol

  7. #7
    prova a modificare lo script cosi:

    Codice PHP:

    <?php
    # Includo il file di configurazione
    require("config.php");

    # Recupero i forum esistenti
    $query mysql_query("SELECT * FROM mioforum
    ORDER BY titolo ASC"
    );

    # Stampo il percorso
    echo "Main";

    # Stampo la lista di tutti i Forum
    while($result mysql_fetch_array($query))
    {
    echo 
    "[*]<a href='forum.php?f=" $result['id'] . "'>";
    echo 
    "$result['titolo']</a>";
    }

    include (
    'qualsiasi.php');
    ?>
    Fa sapere =P

    Buona fortuna


  8. #8
    Utente di HTML.it
    Registrato dal
    Jan 2005
    Messaggi
    579
    Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /membri2/scacchirakoforum/vediamo.php on line 16

    questo errore mi compare per il codice che mi hai dato

    grazie
    ciao
    l'uomo è tutto ciò che non può essere

    http://www.ebug.it Discussioni da web Designer

    http://www.ebug.it/?p=354 e Dart Fener dove lo mettiamo lol

  9. #9
    Utente di HTML.it
    Registrato dal
    Jan 2005
    Messaggi
    579
    c'è qualkuno ke può aiutarmi??
    grazie
    ciao
    l'uomo è tutto ciò che non può essere

    http://www.ebug.it Discussioni da web Designer

    http://www.ebug.it/?p=354 e Dart Fener dove lo mettiamo lol

  10. #10
    prima cosa:

    inserisci questo
    Codice PHP:

    $query
    =mysql_query("qui scrivi qualsiasi query") or die("Query fallita : ".mysql_error() ); 
    sennò non capirai mai se fai un errore!!!
    "Due cose riempiono l’animo di ammirazione e venerazione sempre nuova e crescente, quanto piú spesso e piú a lungo la riflessione si occupa di esse: il cielo stellato sopra di me, e la legge morale in me..." Immanuel Kant

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.