title: AES encrypted variable doesn't get inserted PHP - Mysqli Prepared Statement
body: <p>I have a variable which has to be encrypted and after that saved to the database via mysqli prepared statement. I use AES-256-CTR. </p>
  
  <pre><code>$tabvar = openssl_encrypt($final, $encryptionMethod, $secret, OPENSSL_RAW_DATA, $iv);
  </code></pre>
  
  <p>After the encryption the result looks like this: <strong>5œœ¼Ç=áüû;€é?</strong></p>
  
  <p>This is my php insert code:</p>
  
  <pre><code>$ins = mysqli_prepare($db, "INSERT INTO tab (tid, tabvar) VALUES (?,?)");
  mysqli_stmt_bind_param($ins, "ss",$tid,$tabvar); mysqli_stmt_execute($ins);
  </code></pre>
  
  <p>Because the $tabvar consist of some very strange characters once encrypted, it doesn't get inserted in the database. If I change $tabvar to "i" the row get's inserted, but the entry under tabvar column is 0?</p>
  
  <p>Does anyone have an idea how to solve this?</p>