title: Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY093]: Invalid parameter number: no parameters were bound
body: <p>I get this error when I run the code below:</p>
  
  <blockquote>
    <p>Fatal error: Uncaught exception 'PDOException' with message
    'SQLSTATE[HY093]: Invalid parameter number: no parameters were bound'</p>
  </blockquote>
  
  <pre><code>&lt;?php
  include_once("class.user.php");
  include('dbconfig.php');
  if(isset($_REQUEST["submit"])) {
      if (!empty($_GET["title"]) &amp;&amp; !empty($_GET["content"]) &amp;&amp; !empty($_GET["category"]) &amp;&amp; !empty($_GET["price"])) {
          $sql = "INSERT INTO project VALUES (NULL, :title, :content, :userid, :price, :category);";
          $result = $DB_con-&gt;prepare($sql);
          $result-&gt;bindValue(":title", $_GET["title"]);
          $result-&gt;bindValue(":content", $_GET["content"]);
          $result-&gt;bindValue(":userid", $_SESSION["x"]);
          $result-&gt;bindValue(":price", $_GET["price"]);
          $result-&gt;bindValue(":category", $_GET["category"]);
          $_SESSION['idu'] = $DB_con-&gt;lastInsertId();
          $sql_pro='select * from project WHERE title=:title';
          $result_pro=$DB_con-&gt;prepare($sql_pro);
          $result_pro-&gt;execute();
          $row_pro=$result_pro-&gt;fetch(PDO::FETCH_ASSOC);
          if($result_pro-&gt;rowCount() &gt;0 ){
              $_SESSION['idu'] = $row_pro['id'];
              return true;
          }
  
          $sql_upload="INSERT INTO upload VALUES (NULL, :idp , :address);";
          $result_up=$DB_con-&gt;prepare($sql_upload);
          $result_up-&gt;bindParam(':address',$_SESSION['upload']);
          $result_up-&gt;bindParam(':idp',$_SESSION['idu']);
          $result_up-&gt;execute();
          header('location:../single-project.php');
          exit;
      } else {
          header("location:../create.php?error=10");
          exit;
      }
  }
  
  
  ?&gt;
  </code></pre>
  
  <p>When remove execute() function call there is no error !
  but it does not show title or any content .How can this be fixed?</p>
  
  <pre><code>&lt;?php
  include("controller/check-single-project.php");
  include("header.html");
  ?&gt;
  &lt;div class="col-sm-6 col-sm-offset-3" style="margin-top: 50px;"&gt;
      &lt;h1 class="text-right"&gt;&lt;?php echo $prosingle_r-&gt;pro_single('title'); ?&gt;&lt;/h1&gt;
      &lt;div class="text-right"&gt;
          &lt;p class="content-txt"&gt;&lt;?php echo $prosingle_r-&gt;pro_single('content'); ?&gt;&lt;/p&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>