I am having a small problem updating my cart because of "undefined index:quantity message coming up on my text box.On the last line of my code. what is wrong with the code? Any kind consideration will be highly appreciated.
function edit_quantity(){
if(isset($_POST['update_cart'])){
$quantity=$_POST['quantity'];
$sql3="UPDATE Shopcart set qty='$quantity'";
$sql3_run=mysqli_query($conn,$sql3);
$_SESSION['quantity']=$quantity;
$total=$total*$quantity;
}
echo $_SESSION['quantity'];
}