title: Syntax error in PHP login page query
body: <p>I am trying to make a PHP login page that checks weather the user entered details are in the database but it returns the following error:</p>
  
  <blockquote>
    <p>Fatal error: 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 
        'SLEECT * FROM users where username = NULL AND password = NULL' at line 1 in 
        C:\xampp\htdocs\sign\login.php:18 Stack trace: #0 
        C:\xampp\htdocs\sign\login.php(18): PDOStatement->execute() #1<br>
        C:\xampp\htdocs\sign\login.php(31): SignIn() #2 {main} thrown in 
        C:\xampp\htdocs\sign\login.php on line 18</p>
  </blockquote>
  
  <p>What am I doing wrong and how can I fix it?</p>
  
  <hr>
  
  <pre><code>&lt;?php  
  include('connection.php');
  $username =$_POST['username'];
  $password = $_POST['password'];
  if($username == '') {
  $errmsg_arr[] = 'You must enter your Username';
  $errflag = true;
  }
  if($password == '') {
  $errmsg_arr[] = 'You must enter your Password';
  $errflag = true;
  }
  function SignIn(){
  global $connection;
  $search = $connection-&gt;prepare("SLEECT * FROM users where username = 
  :username AND password = :password");
  $search-&gt;bindParam(':username',$username);
  $search-&gt;bindParam(':password',$password);
  $result = $search-&gt;execute();
  $count = $result-&gt;rowcount();
  if($count&gt; 0)
  {
      $_SESSION['username'] = $_POST['username'];
      echo "welcom to the page ";
  }
  else{
      echo "wron email or password";
  }
  }
  if(isset($_POST['submit']))
  {
  SignIn();
  }
  ?&gt;
  </code></pre>
  
  <p>the code written in <code>connection.php</code> is </p>
  
  <pre><code>&lt;?php
  try{
  $connection = new PDO('mysql:host=localhost;dbname=signup;charset=utf8mb4', 
  'root', '');
  $connection-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  }catch(PDOException $err){
  echo $err-&gt;getMessage();
  die();
  }
  ?&gt;
  </code></pre>
  
  <p>the HTML code written is </p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;form method="POST" action="login.php"&gt;
  &lt;b&gt;Enter your username: &lt;/b&gt;&lt;br&gt;
  &lt;input type="text" name="username"&gt;&lt;br&gt;
  &lt;b&gt;Enter your password: &lt;/b&gt;&lt;br&gt;
  &lt;input type="password" name ="password"&gt;&lt;br&gt;
  &lt;input type="submit" name="submit"&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>