i have created a page which has a table that enables user to delete a record via a delete button but somehow the queary isnt working.
php coding
<?php
include("dbase.php");
$idURL = $_GET['id'];
// Connect to database server
mysql_connect("localhost", "root", "") or die (mysql_error ());
// Select database
mysql_select_db("studiobooking") or die(mysql_error());
// The SQL statement that deletes the record
$query = "DELETE FROM studio WHERE id = '$idURL'";
$result = mysql_query($query);
if($result)
{
echo ('<script type="text/javascript">alert("Record is Deleted !");
window.location = "BookingnDisplay.php"</script>');
}
// Close the database connection
mysql_close();
?>
the part that doesnt work:
$query = "DELETE FROM studio WHERE id = '$idURL'";
$result = mysql_query($query);
but the if($result) runs.
any ideas? thanks in advance!