Ver Mensaje Individual
  #2 (permalink)  
Antiguo 15/07/2015, 11:35
diegoguerrero
 
Fecha de Ingreso: diciembre-2014
Ubicación: Madrid
Mensajes: 274
Antigüedad: 9 años, 4 meses
Puntos: 5
Respuesta: Borrar registro

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 conexión ('.$db->connect_errno.')'
  10.         .$db->connect_errno);
  11. }$consulta = $db->query("SELECT * FROM pedidos");
  12. ?>
  13. <html>
  14. <head>
  15. <title>Pedidos</title>
  16. </head>
  17. <body>
  18. <table align="center" border="2" style="border-collapse:collapse;">
  19. <tr>
  20. <th>Cliente</th>
  21. <th>Prenda</th>
  22. <th>Precio</th>
  23. </tr>
  24. <?php
  25. header('Content-Type: text/html; charset=UTF-8');
  26. while ($row=$consulta->fetch_array())
  27. {
  28. echo '<tr><td align="center">'.$row['cliente'].'</td>';
  29. echo '<td align="center">'.$row['prenda'].'</td>';
  30. echo '<td align="center">'.$row['precio'].' €.</td></tr>';
  31. echo '<td align="center"><a href'
  32. }
  33. ?>
  34. </table>
  35. </body>
  36. </html>