Ver Mensaje Individual
  #7 (permalink)  
Antiguo 20/01/2014, 12:36
xavipr
 
Fecha de Ingreso: enero-2014
Mensajes: 10
Antigüedad: 10 años, 3 meses
Puntos: 0
Respuesta: tabla dinamica de una columna asociada a un solo item de base de datos

hola, estoy teniendo un problema con el codigo "Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\wamp\www\Repuestos\getuser.php on line 24
", la pagina getuser.php tiene el siguiente código
Código PHP:
Ver original
  1. <?php
  2. $q = intval($_GET['q']);
  3.  
  4. $con = mysqli_connect('localhost','root','','tuercas');
  5. if (!$con)
  6.   {
  7.   die('Could not connect: ' . mysqli_error($con));
  8.   }
  9.  
  10. mysqli_select_db($con,"tuercas");
  11. $sql="SELECT * FROM user WHERE SKU = '".$q."'";
  12.  
  13. $result = mysqli_query($con,$sql);
  14.  
  15. echo "<table border='1'>
  16. <tr>
  17. <th>Firstname</th>
  18. <th>Lastname</th>
  19. <th>Age</th>
  20. <th>Hometown</th>
  21. <th>Job</th>
  22. </tr>";
  23.  
  24. while($row = mysqli_fetch($result))
  25.   {
  26.   echo "<tr>";
  27.   echo "<td>" . $row['id'] . "</td>";
  28.   echo "<td>" . $row['SKU'] . "</td>";
  29.   echo "<td>" . $row['nombre'] . "</td>";
  30.   echo "<td>" . $row['precio'] . "</td>";
  31.   echo "</tr>";
  32.   }
  33. echo "</table>";
  34.  
  35. ?>