Hai, i'm not sure how to fix this error. any other method to update database?
Error:
PHP:
<?php
$con=mysqli_connect("localhost","root","","sportify");
//check connection
if (mysqli_connect_errno())
{
echo "failed";
}
/* mysql_select_db(stationary, $con) or die("Could not select database"); */
/* include ('connection.php'); */
//$id = $_GET['id'];
$sql="UPDATE admin SET name='$_POST[name]', email='$_POST[email]', phone='$_POST[phone]', address='$_POST[address]' WHERE id = '$_POST[id]'";
if (mysqli_query($con,$sql))
{
header("Location: main_admin.php?page=admin_edit_profile.php&id='$_POST[id]'");
//?id=".$_POST['id']."
}
mysqli_close($con);
?>