title: PHP passing encrypted password by parameter
body: <p>I pass encrypted password in the parameters of a function to connect to a database, but I don't know how to use it to connect to database?</p>
  
  <pre><code>function get_connectivity($pwd){    
      $host = "localhost";
      $user = "root";
      $pass = $pwd;
      $database = "testing";
  
      $db = new mysqli($host, $user, $pass, $database);
      if ($db-&gt;connect_errno) {
          return false;
          exit();
      }   
      $db-&gt;close();
      return true;
  }
  </code></pre>
  
  <p>I call it this way:</p>
  
  <pre><code>get_connectivity(sha1("example"));
  </code></pre>
  
  <p>Is this even possible? Thanks.</p>