This is the checkout code. my values of the query are not functioning. It's not inserting please help me fix this.
            $q = "select * from cart";
            $quer = mysqli_query($con, $q);
            while($q_row = mysqli_fetch_array($quer)){
            $order_id = $q_row['order_id'];
            $prod_id = $q_row['p_id'];
            //get p_id
            $p_id_q = "select * from products where prod_id = '$prod_id'";
            $run_products = mysqli_query($con, $p_id_q);
            $row_product = mysqli_fetch_array($run_products);
            $product_id = $row_product['prod_id'];
            $product_name = $row_product['prod_name'];
            $add_order = "insert into orders (order_id,p_id,prod_name,status) values ('$order_id','$prod_id','$prod_name','Pending')";
            $run_add = mysqli_query($con, $add_order);
            }
        }
        ?>
 
    