title: SQLSTATE[HY093]: Invalid parameter number [string:Exception:private]
body: <blockquote>
    <p>PDOException Object ( [message:protected] => SQLSTATE[HY093]: Invalid parameter number [string:Exception:private] => [code:protected] => HY093 [file:protected] => /home/unfed/public_html/src/php/auth/login.php [line:protected] => 74 [trace:Exception:private] => Array ( [0] => Array ( [file] => /home/unfed/public_html/src/php/auth/login.php [line] => 74 [function] => execute [class] => PDOStatement [type] => -> [args] => Array ( [0] => Array ( [:username] => test ) ) ) [1] => Array ( [file] => /home/unfed/public_html/src/php/auth/login.php [line] => 137 [function] => query [args] => Array ( [0] => INSERT INTO users (username,password,email,image) VALUES (:username,:password,:email,'test') [1] => Array ( [:username] => test ) [2] => Array ( [:password] => test ) [3] => Array ( [:email] => Theres an email here ) ) ) [2] => Array ( [file] => /home/unfed/public_html/signup/index.php [line] => 53 [function] => register [args] => Array ( [0] => test [1] => Theres an email here [2] => test ) ) ) [previous:Exception:private] => [errorInfo] => Array ( [0] => HY093 ) )</p>
  </blockquote>
  
  <p>Dont have a clue why this is happening.
  Heres my PHP:</p>
  
  <pre><code>//Create a new function named LoggedIn, And apply database info;
  function Connect($host = 'localhost',$username = 'unfed_admin',$password = 'x',$dbname = 'unfed_auth') {
  
      //Try execute the PHP with no errors;
      try {
  
          //Create a PDO Session;
          $con = new PDO("mysql:host=$host;dbname=$dbname", $username, $password);
  
          //Session Attributes;
          $con-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
          $con-&gt;setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
  
      }
  
      //Catch all PDOException errors;
      catch (PDOException $e) {
  
          //If any errors print result;
          echo "&lt;code&gt;&lt;pre&gt;".print_r($e)."&lt;/pre&gt;&lt;/code&gt;";
  
          //Make the PDO session false;
          $con = false;
      }
  
      //If no errors happened Make the PDO session true;
      return $con;
  }
  //Create a new function named query;
  function query($sql = false,$bind = false,$obj = false) {
  
      //Prepare The SQL Query;
      $query = Connect()-&gt;prepare($sql);
  
      $res = true;
  
      //Execute Binded Query;
      try { $query-&gt;execute($bind); $res = true; }
  
      catch (PDOException $e) { 
  
          //If any errors print result;
          echo "&lt;code&gt;&lt;pre&gt;".print_r($e)."&lt;/pre&gt;&lt;/code&gt;";
  
          $res = false;
  
      }
  
      //If no errors happened Make $row true;
      return $res;
  
  }
  //Create a new function named user_login;
  function register($username = false, $email = false, $password = false) {
  
      global $registeroutput;
  
      //Fetch for the username and email to see if they are already used;
      $fetchusername = fetch("SELECT username FROM users WHERE username = :username",array(":username"=&gt;$username));
      $fetchemail = fetch("SELECT email FROM users WHERE email = :email",array(":email"=&gt;$email));
      if(empty($fetchusername)) {
  
          if(empty($fetchemail)) {
  
              //Register the user;
              query("INSERT INTO users (username,password,email,image) VALUES (:username,:password,:email,'test')",array(":username"=&gt;$username),array(":password"=&gt;$password),array(":email"=&gt;$email));
              $registeroutput = 'Success';
  
          } else { $registeroutput = 'Email Error'; }
  
      } else { $registeroutput = 'Username Error'; }
  
      //If no errors happened Make the $valid true;
      return true;
  
  }
  </code></pre>
  
  <p>Ignore the comment tags on the PHP code haven't updated them to be related. I have 0 clue why this is happening.</p>