Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it
    Registrato dal
    Jun 2006
    Messaggi
    794

    Problema che non riesco a risolvere

    POsto questo codice...

    $conn = mysql_connect($db_path,$db_user,$db_password);
    mysql_select_db($db_name,$conn);
    $query = "SELECT * FROM prodotto WHERE catalogo = '$catalogo'";
    $res=mysql_query($query,$conn);
    ?>
    <table border="0" width="538" id="table1" height="99" align="center">
    <?PHP
    $numero = mysql_num_rows($query);
    if ($numero>0){
    $i = 0;
    while ($selettore = mysql_fetch_array($res)){
    ?>
    <tr>
    <td width="110" rowspan="3">[img]/public/<?=$selettore[11]?>[/img]</td>
    <td width="82"><?=$selettore[5]?></td>
    <td rowspan="3" width="110"><?=$selettore[7]?></td>
    <td width="82">€<?=$selettore[9]?></td>
    <td rowspan="3" width="110"></td>
    <td width="82"></td>
    </tr>
    <?PHP
    $i = $i + 1;
    if ($selettore = mysql_fetch_array($res)){
    ?>
    <tr>
    <td width="110" rowspan="3">[img]/public/<?=$selettore[11]?>[/img]</td>
    <td width="82"><?=$selettore[5]?></td>
    <td rowspan="3" width="110"><?=$selettore[7]?></td>
    <td width="82">€<?=$selettore[9]?></td>
    <td rowspan="3" width="110"></td>
    <td width="82"></td>
    </tr>
    <?PHP
    $i = $i + 1;
    }
    if ($selettore = mysql_fetch_array($res)){
    ?>
    <tr>
    <td width="110" rowspan="3">[img]/public/<?=$selettore[11]?>[/img]</td>
    <td width="82"><?=$selettore[5]?></td>
    <td rowspan="3" width="110"><?=$selettore[7]?></td>
    <td width="82">€<?=$selettore[9]?></td>
    <td rowspan="3" width="110"></td>
    <td width="82"></td>
    </tr>
    <?PHP
    $i = $i + 1;
    }
    if ($i == 3){
    ?>


    <?PHP
    $i = 0;
    }
    }
    }
    else{
    ?>
    <tr><td dorder="0" align="center">Seleziona un catalogo</td></tr>
    <?PHP
    }
    ?>
    </table>
    <?PHP
    mysql_close($db);
    ?>
    </body>
    </html>
    <?PHP
    ?>

    $numero contiene un valore nullo... come mai?

  2. #2
    Utente di HTML.it L'avatar di deleted_id_48586
    Registrato dal
    Nov 2002
    Messaggi
    1,732
    $numero = mysql_num_rows($res);

  3. #3
    Utente di HTML.it
    Registrato dal
    Jun 2006
    Messaggi
    794
    Grazie mille..
    SEI UN GRANDE!!!

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.