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

Tengo esto y no funciona:
Código PHP:
Ver original
  1. <?php
  2. $carga = $_GET['id'];
  3. $mysqli = new MySQLi('localhost', 'root', '', 'AppSastre');
  4. $result = $mysqli->query("SELECT * FROM pedidos WHERE $carga = id AND $cliente = cliente AND $prenda = prenda AND $precio = precio");
  5. $row_result = $result->fetch_assoc();
  6. $totalRows_result = mysqli_num_rows($result);
  7. ?>
  8. <html>
  9. <head>
  10. <title>Modificar registro</title>
  11. </head>
  12. <body>
  13. <form action="guardarcambios.php" method="post">¢
  14.     <input type="text" value="<?php echo $cliente?>"/>
  15. </form>
  16. </body>
  17. </html>
Me salen los errores:
Notice: Undefined index: id in /Applications/XAMPP/xamppfiles/htdocs/sastre/modificar.php on line 2

Notice: Undefined variable: cliente in /Applications/XAMPP/xamppfiles/htdocs/sastre/modificar.php on line 4

Notice: Undefined variable: prenda in /Applications/XAMPP/xamppfiles/htdocs/sastre/modificar.php on line 4

Notice: Undefined variable: precio in /Applications/XAMPP/xamppfiles/htdocs/sastre/modificar.php on line 4

Fatal error: Call to a member function fetch_assoc() on boolean in /Applications/XAMPP/xamppfiles/htdocs/sastre/modificar.php on line 5

Dice que no he definido los tres campos pero, ¿no los he definido donde el MySQL?

Además, ¿en el archivo guardar_cambios.php basta con poner el código UPDATE...?