title: Password hashing doesn't work
body: <p>I'm inserted some users into the MySQL database </p>
  
  <pre><code>$register_query = " INSERT INTO user ( name, password, permission_id) 
  VALUES ( '$username', SHA('$password_01'), '1' ) ";
  </code></pre>
  
  <p>I wants to read the user table for logging in</p>
  
  <pre><code>require_once('initializing.php');
  
  class DbPlus extends MySQLDatabaseConnection{
  
  public $database;
  
  function __construct()
  {
      $this-&gt;database = parent::connection();
  }
  
  public function reading_table($table, $query, $where = null, $limit = null, $order = null){
  
      $query = "SELECT {$query} FROM {$table}";
      if ( isset($where) ) {
          $query .= " WHERE {$where}";
  
      }
      if ( isset($order) ){
          $query .= " ORDER BY {$order}";
      }
      if ( isset($limit) ) {
          $query .= " LIMIT {$limit}";
      }
  
      // $data = $this-&gt;database-&gt;query($query);
      $data = $this-&gt;database-&gt;query($query);
  
      $rows = array();
      while ( $row = $data-&gt;fetch_object() ) {
          $rows[] = $row;
  
      }
  
      return $rows;
      }
  }
  
  $dbplus = new DbPlus;
  
  $login_qry_slct = "id,name,password,permission_id";
  $login_qry_whr = "name ='test' AND password = SHA('test')";
  $result = $dbplus-&gt;reading_table('user', $login_qry_slct, $login_qry_whr );
  var_dump($result);
  </code></pre>
  
  <p>For testing purpose I inserted <code>name=test</code>, and <code>password=test</code>. I did it in two ways, with and without SHA(). When I inserted the password 'test' without hashing, the select query works fine (note: it is for testing purposes) and returns the non hashed test user.</p>
  
  <pre><code> $login_qry_whr = "name ='test' AND password = 'test'";
  </code></pre>
  
  <p>But when I using SHA</p>
  
  <pre><code>$login_qry_whr = "name ='test' AND password = SHA('test')";
  </code></pre>
  
  <p>Returns <code>array(0) { }</code> (note: there is hashed version saved in in the user table too)</p>
  
  <p>What am I doing wrong with SHA()?</p>