title: {"error":{"text":SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens}} <
body: <p>pls am trying to create a login and registration system using pdo and mysql and this error keeps popping up, i read thru all the answers on this kind of error but cant seem to rectify mine... heres the code..</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
  
  class userClass
  {
    
  /* User Login */
       public function userLogin($email,$password)
       {
  
            $db = getDB();
            $hash_password= hash('sha256', $password);
            $stmt = $db-&gt;prepare("SELECT uid FROM users WHERE email=:email AND password=:hash_password");  
            $stmt-&gt;bindParam("email", $email,PDO::PARAM_STR) ;
            $stmt-&gt;bindParam("hash_password", $hash_password,PDO::PARAM_STR) ;
            $stmt-&gt;execute();
            $count=$stmt-&gt;rowCount();
            $data=$stmt-&gt;fetch(PDO::FETCH_OBJ);
            $db = null;
            if($count)
            {
                  $_SESSION['uid']=$data-&gt;uid;
                  return true;
            }
            else
            {
                 return false;
            }    
       }
  
       /* User Registration */
       public function userRegistration($email,$password,$fname,$lname,$dob,$sex,$country,$state_resd,$phone_no,$profile_pic)
       {
            try{
            $db = getDB();
            $st = $db-&gt;prepare("SELECT uid FROM users WHERE email=:email, password=:hash_password, fname=:fname, lname=:lname, dob=:dob, sex=:sex, country=:country, state_resd=:state_resd, phone_no=:phone_no, profile_pic=:profile_pic");  
            /**$st-&gt;bindParam("username", $username,PDO::PARAM_STR);**/
            $st-&gt;bindParam("email", $email,PDO::PARAM_STR);
            $st-&gt;execute();
            $count=$st-&gt;rowCount();
            if($count&lt;1)
            {
            $stmt = $db-&gt;prepare("INSERT INTO users(email,password,fname,lname,dob,sex,country,state_resd,phone_no,profile_pic) VALUES (:email,:hash_password:fname,:lname,:dob,:sex,:country,:state_resd,:phone_no)");  
            /**$stmt-&gt;bindParam("username", $username,PDO::PARAM_STR) ;**/
            
            $stmt-&gt;bindParam("email", $email,PDO::PARAM_STR) ;
     $hash_password= hash('sha256', $password);
            $stmt-&gt;bindParam("hash_password", $hash_password,PDO::PARAM_STR) ;
            $stmt-&gt;bindParam("fname", $fname,PDO::PARAM_STR) ;
     $stmt-&gt;bindParam("lname", $lname,PDO::PARAM_STR) ;
     $stmt-&gt;bindParam("dob", $dob,PDO::PARAM_STR) ;
     $stmt-&gt;bindParam("sex", $sex,PDO::PARAM_STR) ;
     $stmt-&gt;bindParam("country", $country,PDO::PARAM_STR) ;
     $stmt-&gt;bindParam("state_resd", $state_resd,PDO::PARAM_STR) ;
     $stmt-&gt;bindParam("phone_no", $phone_no,PDO::PARAM_STR) ;
     $stmt-&gt;bindParam("profile_pic", $profile_pic,PDO::PARAM_STR) ;
     
            $stmt-&gt;execute();
            $uid=$db-&gt;lastInsertId();
            $db = null;
            $_SESSION['uid']=$uid;
            return true;
  
            }
            else
            {
            $db = null;
            return false;
            }
            
           
            } 
            catch(PDOException $e) {
            echo '{"error":{"text":'. $e-&gt;getMessage() .'}}'; 
            }
       }
       
       /* User Details */
       public function userDetails($uid)
       {
          try{
            $db = getDB();
            $stmt = $db-&gt;prepare("SELECT email FROM users WHERE uid=:uid");  
            $stmt-&gt;bindParam("uid", $uid,PDO::PARAM_INT);
            $stmt-&gt;execute();
            $data = $stmt-&gt;fetch(PDO::FETCH_OBJ);
            return $data;
           }
           catch(PDOException $e) {
            echo '{"error":{"text":'. $e-&gt;getMessage() .'}}'; 
            }
  
       }
  
  
  }
  ?&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>and for the registration page</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php 
  include("config.php");
  include('class/userClass.php');
  $userClass = new userClass();
  
  $errorMsgReg='';
  $errorMsgLogin='';
  if (!empty($_POST['loginSubmit'])) 
  {
  $email=$_POST['email'];
  $password=$_POST['password'];
  
   if(strlen(trim($email))&gt;1 &amp;&amp; strlen(trim($password))&gt;1 )
     {
      $uid=$userClass-&gt;userLogin($email,$password);
      if($uid)
      {
          $url=BASE_URL.'home.php';
          header("Location: $url");
      }
      else
      {
          $errorMsgLogin="Please check login details.";
      }
     }
  }
  
  if (!empty($_POST['signupSubmit'])) 
  {
  
   /**$username=$_POST['usernameReg'];**/
   
   $email=$_POST['emailReg'];
   $password=$_POST['passwordReg'];
      $fname=$_POST['fnameReg'];
      $lname=$_POST['lnameReg'];
      $dob=$_POST['dobReg'];
      $sex=$_POST['sexReg'];
      $country=$_POST['countryReg'];
      $state_resd=$_POST['state_resdReg'];
      $phone_no=$_POST['phone_noReg'];
      $profile_pic=$_POST['profile_picReg'];
   /**$username_check = preg_match('~^[A-Za-z0-9_]{3,20}$~i', $username);**/
   $email_check = preg_match('~^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.([a-zA-Z]{2,4})$~i', $email);
   $password_check = preg_match('~^[A-Za-z0-9!@#$%^&amp;*()_]{6,20}$~i', $password);
  
   if($email_check &amp;&amp; $password_check &amp;&amp; strlen(trim($fname))&gt;0) 
   {
      $uid=$userClass-&gt;userRegistration($email,$password,$fname,$lname,$dob,$sex,$country,$state_resd,$phone_no,$profile_pic);
      if($uid)
      {
       $url=BASE_URL.'home.php';
       header("Location: $url");
      }
      else
      {
        $errorMsgReg="Email already exits.";
      }
      
   }
  
  
  }
  
  ?&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;style&gt;
  #container{width: 700px}
  #login,#signup{width: 300px; border: 1px solid #d6d7da; padding: 0px 15px 15px 15px; border-radius: 5px;font-family: arial; line-height: 16px;color: #333333; font-size: 14px; background: #ffffff;rgba(200,200,200,0.7) 0 4px 10px -1px}
  #login{float:left;}
  #signup{float:right;}
  h3{color:#365D98}
  form label{font-weight: bold;}
  form label, form input{display: block;margin-bottom: 5px;width: 90%}
  form input{ border: solid 1px #666666;padding: 10px;border: solid 1px #BDC7D8; margin-bottom: 20px}
  .button {
      background-color: #5fcf80 !important;
      border-color: #3ac162 !important;
      font-weight: bold;
      padding: 12px 15px;
      max-width: 300px;
      color: #ffffff;
  }
  .errorMsg{color: #cc0000;margin-bottom: 10px}
  &lt;/style&gt;
  &lt;body&gt;
  &lt;div id="container"&gt;
  &lt;&lt;div id="signup"&gt;
  &lt;h3&gt;Registration&lt;/h3&gt;
  &lt;form method="post" action="" name="signup"&gt;
  &lt;label&gt;Email&lt;/label&gt;
  &lt;input type="text" name="emailReg" autocomplete="off" /&gt;
  &lt;label&gt;Password&lt;/label&gt;
  &lt;input type="password" name="passwordReg" autocomplete="off"/&gt;
  
  &lt;label&gt;First Name&lt;/label&gt;
  &lt;input type="text" name="fnameReg" autocomplete="off" /&gt;
  &lt;label&gt;Last Name&lt;/label&gt;
  &lt;input type="text" name="lnameReg" autocomplete="off" /&gt;
  
  &lt;label&gt;Sex&lt;/label&gt;
  &lt;input type="text" name="sexReg" autocomplete="off" /&gt;
  
  
  &lt;label&gt;Date of Birth&lt;/label&gt;
  &lt;input type="text" name="dobReg" autocomplete="off" /&gt;
  &lt;label&gt;Country&lt;/label&gt;
  &lt;input type="text" name="countryReg" autocomplete="off" /&gt;
  
  &lt;label&gt;State of Residence&lt;/label&gt;
  &lt;input type="text" name="state_resdReg" autocomplete="off" /&gt;
  
  &lt;label&gt;Phone Number&lt;/label&gt;
  &lt;input type="text" name="phone_noReg" autocomplete="off" /&gt;
  &lt;label&gt;Profile photo&lt;/label&gt;
  &lt;input type="text" name="profile_picReg" autocomplete="off" /&gt;
  &lt;!--&lt;label&gt;Username&lt;/label&gt;
  &lt;input type="text" name="usernameReg" autocomplete="off" /&gt;--&gt;
  
  
  &lt;div class="errorMsg"&gt;&lt;?php echo $errorMsgReg; ?&gt;&lt;/div&gt;
  &lt;input type="submit" class="button" name="signupSubmit" value="Create Counter"&gt;
  &lt;a href="index.php" class="to_register"&gt; Login &lt;/a&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  
  
  
  
  &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>pls help me take a look at my codes to see what am doing wrong as am close to a novice</p>