title: why my table is empty when i have no error in php code?
body: <pre><code>&lt;?php
      session_start();
  ?&gt;
  &lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;Untitled Document&lt;/title&gt;
  &lt;/head&gt;
  </code></pre>
  
  <p>Guys I make a table for shoping bag and it name is basket. I get id at product table name and price too. and my basket table is like </p>
  
  <p><code>this(id[int],name[varchar],email[varchar],price[decimal],count[int],reduction[int],done[boolean]).</code> </p>
  
  <p>at the end when I click on a shopping bag that link could add count, but my table is empty no have a row.</p>
  
  <pre><code>&lt;body&gt;
  
      &lt;?php
          include"database.php";
          $name="";
          $price=0;
          $email=$_SESSION["email"];
          $done=false;
          $count=0;
          // i get id form product table and product table like this(id[int],description[text],price[decimal])//
  
          $id=$_GET["id"];
          $query="SELECT * FROM product WHERE id=:id";
          $result=$connect-&gt;prepare($query);
          $result-&gt;bindparam(":id",$id);
          $result-&gt;execute();
          while($row=$result-&gt;fetch(PDO::FETCH_ASSOC)){
              $name=$row["names"];
              $price=$row["price"];
  
          }
  
          // and write a query  for make count and insert or update in basket table;
          $sql="SELECT * FROM basket WHERE name=:name and email=:email and done=:done";
          $result=$connect-&gt;prepare($sql);
          $result-&gt;bindparam(":name",$name);
          $result-&gt;bindparam(":email",$email);
          $result-&gt;bindparam(":done",$done);
          $result-&gt;execute();
          while($row=$result-&gt;fetch(PDO::FETCH_ASSOC)){
  
              if(!empty($row["count"])){
                  $count=$row["count"];
              }else{
                  $count=0;
              }
  
          }
  
          if($count&gt;0){
              $upquery="UPDATE basket SET count=:count WHERE name=:name";
              $result=$connect-&gt;prepare($upquery);
              $count++;
              $result-&gt;bindparam(":count",$count);
              $result-&gt;bindparam(":name",$name);
              $result-&gt;execute();
          }else{
              // for now i insert the info to table and give 0 value for reduction// 
              $count1=1;
              $reduction=0;
              $inquery="INSERT INTO basket (name,email,price,count,reduction)VALUES(:name,:email,:price,:count,:reduction)";
              $result=$connect-&gt;prepare($inquery);
              $result-&gt;bindparam(":name",$name);
              $result-&gt;bindparam(":email",$email);
              $result-&gt;bindparam(":price",$price);
              $result-&gt;bindparam(":count",$count1);
              $result-&gt;bindparam(":reduction",$reduction);
              $result-&gt;execute();
          }
      ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I have no PHP error, so why my table is empty? </p>
  
  <p>I echo $email and $name and $price and $done and $done and $reduction and that are correct. </p>
  
  <p>What is wrong please tell me i am beginnثr in programmer world.</p>