当脚本执行PHP / MySQL时失去变量值

My GET value is fine on first if statement but when it hits update_submit I get an undefined variable error. This is still test script so there's no validation

 <?php
session_start();
include "connect.php";

error_reporting(E_ALL);
ini_set('display_errors','1');

if(isset($_GET['pid']))
{
$get_item = $_GET['pid'];

echo "pid" . $get_item;//<--has value here

$get_products = $db->prepare("select * from `item` where 
                            `item_id` = '$get_item' LIMIT 1");

$get_products->execute();

    while ($row = $get_products->fetch())
    {
        $user_id =  $row['user_id'];
        $item_name = $row['item_name'];
        $item_description = $row['item_description'];
        $image = $row['photopath'];

    }

}

echo "pid" .$get_item;//<---has value here

if(isset($_POST['cancel_edit']))
{
header("Location: manage_items.php");
exit();
}
if(isset($_POST['update_submit']))//<<---lose it here
{
$get_products = $db->prepare("select `photopath` from `item` where 
                            `item_id` = '$get_item' LIMIT 1");
$get_products->execute();
$path= $get_products->fetchColumn(6);

FORM

<form action="item_edit.php" method="post" enctype="multipart/form-data">

<input type = "text" name="item_name" value="<?php echo $item_name ?> "/>
<textarea name="item_description"><?php echo $item_description ?></textarea>

<p> <img src="<?php echo $image; ?>" width="75" height="75" /></p>
<input type="file" name="image_edit" value="<?php echo $image ?>"/>

<input name="img_edit" type="hidden" value="<?php echo $image ?>"/>
<input name="edit_form_id" type="hidden" value="<?php echo $get_item ?>">

<p><input type="submit" name="update_submit" value="Update"/></p>
<p><input type="submit" name="cancel_edit" value="Cancel"/></p>
</form>

If coming from the same form, are you mixing $_GET and $_POST settings for your form? You have the value when using ($_GET['pid']), but not when using ($_POST['update_submit']).