I'm extremely new to mysql, like this weekend new. I can't figure out how to redirect using header(). What am I missing? BTW this page is test_db.php
<?php include("mysql_connect.php"); ?>
<?php
$sql = "SELECT * FROM budget ORDER BY id DESC";
$query = mysql_query($sql) or die (mysql_error());
if (isset($_GET['recordId'])) {
$id = mysql_real_escape_string($_GET['recordId']);
$sql_delete = "DELETE FROM budget WHERE id = {$id}";
mysql_query($sql_delete) or die(mysql_error());
header("Location: test_db.php");
exit();
}
?>
... link in question...
<a href="test_db.php?recordId=<?php echo $row['id']; ?>">Delete</a>
looks like it goes to the connection page after the Delete button is clicked and redirect doesn't work. I can connect, this code deletes fine, but I want it to stay on this same page.
please help, thank you.