title: why does my $type variable get saved as 'Admin''?
body: <p>am trying to get the number of admins in my table it does work normally but now that i added inner join for two tables i get this error of an extra ' in the word admin and i don't know how to remove it
  so here is my function in userc.php :</p>
  <pre><code>    function admincountsearch($key)
      {
          $con = config::getConnexion();
          $sql = &quot;SELECT  user.username,user.name,user.lastname,user.id, 
                      user.email, user.image, user.verified, usero.type, 
                      usero.description,usero.ban 
              FROM user 
                  INNER JOIN usero ON user.id_o = usero.id 
              WHERE user.username LIKE :keyword 
                  OR user.id LIKE :keyword 
                  OR user.name LIKE :keyword 
              WHERE usero.type=:type &quot;;
          $stmt = $con-&gt;prepare($sql);
          $type =&quot;Admin&quot; ;
          $stmt-&gt;bindValue(':keyword', '%' . $key . '%', PDO::PARAM_STR);
          $stmt-&gt;bindValue(':type',$type, PDO::PARAM_STR);
          $stmt-&gt;execute();
          $stmt-&gt;fetch();
          $results = $stmt-&gt;rowCount();
          return $results;
      }
  </code></pre>
  <p>and here is how i call it in find.php:</p>
  <pre><code>&lt;span class=&quot;info-box-number&quot;&gt;&lt;?php echo $userc-&gt;admincountsearch($key); ?&gt;&lt;/span&gt;
  </code></pre>
  <p>and here is the error that i got:</p>
  <blockquote>
  <p>:  Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE usero.type='Admin'' at line 2 in C:\xampp\htdocs\Project\Integre\Controller\userc.php:458
  Stack trace:
  #0 C:\xampp\htdocs\Project\Integre\Controller\userc.php(458): PDOStatement-&gt;execute()
  #1 C:\xampp\htdocs\Project\Integre\Views\find.php(200): userc-&gt;admincountsearch('g')
  #2 {main}
  thrown in</p>
  </blockquote>