<?php
    include 'load.php';
    require_once 'db_connection.php';  
    
       
    $h = 0;

    if(mysqli_num_rows(mysqli_query($conn, "SELECT * FROM mobiletemporarycart WHERE orderid='0' AND hold='1'")) > 0){
        $sql = "UPDATE mobiletemporarycart SET hold='0' WHERE orderid='0'"; 
        $h = 0;
    }else{
        $sql = "UPDATE mobiletemporarycart SET hold='1' WHERE orderid='0'"; 
        $h = 1;
    }   


    if ($conn->query($sql) === TRUE) {
        echo $h;
    }
    
?>