I'm trying to redirect via the location command after I do an update to my database. Here is my code:
<?php
include 'config.php';
/*** create a new mysqli object with default database***/
$connection = mysqli_connect($hostname, $username, $password, $dbname) or die ("Unable to connect");
/*** sql to UPDATE a new record ***/
$sql = "UPDATE table1 SET
job_name = '$_POST[job_name]',
job_number = '$_POST[job_number]',
WHERE id = '$_POST[id]'";
//excute query
$result = mysqli_query($connection, $sql) or die ("Error in query: $sql. ".mysqli_error());
// close connection
mysqli_close($connection);
header("Location: ada_project_info.php?id=$id");
?>
I know that it's something small, but I can find it. Thanks for helping me out.
A