Hey everybody. So I am just trying to write a script to delete a row in a MySQL database. Unfortunately I seem to have something wrong...even though I don't get any errors.
Here is a snippet of the code on the page to send the request:
I have checked that the 'id' that was passed was correct. So I know that the code above is working. 'is' is not displayed as a variable above as it isn't directly used in the table. SELECT id, ... FROM amvs...while(list($id,...))
Here is the code from the deleterow.php script:
<?php $dbc = mysqli_connect('server', 'username', 'password', 'database') or die('Error connecting to MySQL server.'); if(isset($_GET['id'])) $id = $_GET['id']; else die("No ID passed"); $sql = "DELETE FROM amvs WHERE id='$id'"; $result = mysqli_query($sql) or die('Error Deleting Record'); Echo "AMV Removed Successfully"; include_once 'getamvs.php'; mysqli_close($dbc); ?>
The only message I get (plus the included page) is AMV Removed Successfully. However if I go to my phpMyAdmin the row is still there and it also shows up in the returned query below the message.
Can someone see something that I'm not?
Edited by UzuNarU: Typo