Counter increment until reaches 2
<p>The following code will stop increment until it reaches 2:</p>

<pre><code>$counter = 1;

if (isset($_POST["isPostBack"])) {

    $result = $dataobj-&gt;getProductsCart($_POST['productid'], $_SESSION["Username"]);

    if (mysql_num_rows($result)) {
         $dataobj-&gt;updateCartQty($_POST['productid'], $_SESSION["Username"], ++$counter);
    }
    else {
        $dataobj-&gt;insertIntoCart($_POST['productid'], $_SESSION["Username"], 1);
        $counter = 1;
    }
}
</code></pre>

<p>Do you know the reason please?</p>
