I have item_users table and field here
userid | user_type |inventory_id |com_code
------------------------------------------
1 | | 4 |sffdfgfdg
I want to before update after select query. error geting Header location is not working becouse $inventory_id
is empty.
<?php
include("myhomeportal/setting/config.php");
$conform = $_GET['conform-email'];
$sql = "UPDATE item_users SET com_code=NULL,type_login='user' WHERE com_code='$conform'";
$result = mysqli_query($conn,$sql) or die(mysqli_error());
$query = mysqli_query($conn, "SELECT * FROM item_users where com_code='$conform'");
$row=mysqli_fetch_array($query);
$inventory_id=$row['inventory_id'];
if($row)
{
header("Location: category.php?inventory_id=$inventory_id");
}
else
{
$msgerr="Error ";
echo "<script type='text/javascript'>alert('$msgerr');</script>";
}
?>