Jump to content

Código não apresenta nenhum erro mas mesmo assim não executa o DELETE


Go to solution Solved by Virneto,

Recommended Posts

Posted

O código não apresenta nenhum erro mas mesmo assim não executa o DELETE.

Criei uma tag para apagar linha a linha e usei GET para isso e mesmo assim não está a funcionar.

tag <td><a href="delete_rows.php?del=$row[ISBN]">delete</a></td>

metodo GET:

include_once('config.php'); if( isset($_GET['del']) ) { $ISBN = $_GET['del']; $sql= "DELETE FROM books WHERE ISBN='$ISBN'"; $res= mysqli_query($conn,$sql) or die("Failed".mysqli_error($conn)); echo "<meta http-equiv='refresh' content='0;url=update.php'>"; } ?

Tem como alguém ajudar pf?

 

Obrigado

Diana

  • Solution
Posted

Viva,

Já verificaste o url que resulta deste link?

9 horas atrás, Diana Madeira disse:

<td><a href="delete_rows.php?del=$row[ISBN]">delete</a></td>

Isto não deveria ser?:

<?php echo "<td><a href='delete_rows.php?del=".$row[ISBN]."'>delete</a></td>"; ?>

"Que inquieto desejo vos tortura, Seres elementares, força obscura? Em volta de que ideia gravitais?" >> Anthero de Quental

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Linuxando.com | ...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.