Ver Mensaje Individual
  #28 (permalink)  
Antiguo 15/07/2015, 11:02
diegoguerrero
 
Fecha de Ingreso: diciembre-2014
Ubicación: Madrid
Mensajes: 274
Antigüedad: 10 años, 2 meses
Puntos: 5
Respuesta: No entiendo el fallo

Ahora está esto así:

Código PHP:
Ver original
  1. <?php
  2. $usuario = "root";
  3. $pass = "";
  4. $host = "localhost";
  5. $base = "AppSastre";
  6.  
  7. $db = new mysqli($host, $usuario, $pass, $base);
  8. if($db->connect_error) {
  9.     die('Error de conexion ('.$db->connect_errno.')'
  10.         .$db->connect_errno);
  11. }$consulta = $db->query("SELECT 'id,cliente,prenda,precio' FROM pedidos");
  12. ?>
  13. <html>
  14. <head>
  15. <title>Pedidos</title>
  16. </head>
  17. <body>
  18. <table align="center">
  19. <thead>
  20. <th>Cliente</th>
  21. <th>Prenda</th>
  22. <th>Precio</th>
  23. </thead>
  24. <?php
  25. while ($row=$consulta->fetch_array())
  26. {
  27. echo '<tr><td>'.$row["cliente"].'</td>';
  28. echo '<td>'.$row["prenda"].'</td>';
  29. echo '<td>'.$row["precio"].'</td></tr>';
  30. }
  31. ?>
  32. </table>
  33. </body>
  34. </html>