Visualizzazione dei risultati da 1 a 3 su 3

Discussione: problema select

  1. #1

    problema select

    salve!
    ho la necessità di fare una select prelevando i dati tra due tabelle, ho buttato giù queste righe ma come output ricevo solamente "Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\Programmi\EasyPHP5.3.0\www\prova\prova\admin\ad min.php on line 59"
    e la tabella senza risultati...
    nn risco a capire dove sta l'errore??

    Codice PHP:
        <?php
    $con 
    mysql_connect("localhost","root","");
    if (!
    $con)
      {
      die(
    'Could not connect: ' mysql_error());
      }

    mysql_select_db("store"$con);
    //query site_user
    $result mysql_query("SELECT nome, cognome, localita, hotel, password, email FROM site_user,site_user_info WHERE site_user_info.id = site_user.id AND verificato = 3");

    echo 
    "<table border='1'>
    <tr>
    <th>Nome</th>
    <th>Cognome</th>
    <th>Hotel</th>
    <th>Località</th>
    <th>Email</th>
    <th>Password</th>
    <th>Abilita</th>
    <th>Elimina</th>
    </tr>"
    ;



    while(
    $row mysql_fetch_array($result))
      {

    echo 
    "<tr>";
    echo 
    "<td>" $row['nome'] . "</td>";
    echo 
    "<td>" $row['cognome'] . "</td>";
    echo 
    "<td>" $row['localita'] . "</td>";
    echo 
    "<td>" $row['hotel'] . "</td>";
    echo 
    "<td>" $row['email'] . "</td>";
    echo 
    "<td>" $row['password'] . "</td>";
      echo 
    "</tr>";
      }
    echo 
    "</table>";

    mysql_close($con);
    ?>

    grazie

  2. #2
    Ti suggerisco di iniziare implementando un codice di gestione degli errori come descritto nel manuale ufficiale:

    http://www.php.net/mysql_query Example #1 Invalid Query

  3. #3
    sei un grande!
    c'era un campo con lo stesso nome in entrambe le tabelle...
    grazie!

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.