title: Hashing and salting in a PDO prepared statement
body: <p>Can someone show me the proper format to use for hashing and salting in a PDO prepared statement? I'm switching from php and trying to get this to work in a simple INSERT statement before worrying about the more complex functions, and nothing that I've seen online has worked. </p>
  
  <p>In php I was doing this: <code>'".sha1($salt + $_POST['password'])."'</code></p>
  
  <p>I've tried:</p>
  
  <pre><code>$password = '123456'; 
  $hash = hash('sha1', $password);
  $pass1 = hash('sha1', $salt . $hash . $password);
  </code></pre>
  
  <p>$salt is defined in config.php, referenced correctly, and works properly in php insert statements.</p>
  
  <p><strong>EDIT -</strong></p>
  
  <p>This is the INSERT statement that I'm using:</p>
  
  <pre><code>$stmt = $conn-&gt;prepare('INSERT INTO customer_info (fname...) VALUES(:fname...)');
  $stmt-&gt;bindParam(':fname', $_POST['fname'], PDO::PARAM_STR);
  $stmt-&gt;execute();   
  </code></pre>