Ver Mensaje Individual
  #14 (permalink)  
Antiguo 15/07/2015, 14:24
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. header('Content-Type=text/html; charset=UTF-8');
  3. ?>
  4. <?php
  5. $usuario = "root";
  6. $pass = "";
  7. $host = "localhost";
  8. $base = "AppSastre";
  9.  
  10. $db = new mysqli($host, $usuario, $pass, $base);
  11. if($db->connect_error) {
  12.     die('Error de conexión ('.$db->connect_errno.')'
  13.         .$db->connect_errno);
  14. }$consulta = $db->query("SELECT * FROM pedidos");
  15. ?>
  16. <html>
  17. <head>
  18. <title>Pedidos</title>
  19. </head>
  20. <body>
  21. <table align="center" border="2" style="border-collapse:collapse;font-family: Georgia;">
  22. <tr>
  23. <th>Cliente</th>
  24. <th>Prenda</th>
  25. <th>Precio</th>
  26. <th>Opciones</th>
  27. </tr>
  28. <?php
  29. header('Content-Type: text/html; charset=UTF-8');
  30. while ($row=$consulta->fetch_array())
  31. {
  32. echo '<tr><td align="center">'.$row['cliente'].'</td>';
  33. echo '<td align="center">'.$row['prenda'].'</td>';
  34. echo '<td align="center">'.$row['precio'].' €</td>';
  35. echo '<form method="get" action="modifica.php"><input type="submit" value="Eliminar registro"></form>';
  36. }
  37.  
  38.  
  39.  
  40.  
  41. /*
  42. <?php
  43. '<td align="center"><a href="#">Eliminar</a> o <a href="modifica.php?id="'.$row['id'].'">Modificar</a></td></tr>';
  44. }
  45. mysqli_close($db);
  46. ?>
  47. </table>
  48. </body>
  49. </html>
  50. */
  51. ?>
Lo que hay etiquetado es porque justo ahora estoy haciendo cambios