php prepared statement
<p>It does not print the result. Dont know why. Everything is neatly commented</p>

<p>I get no error displays, no syntax blasphemes, it just does not print any result. However, I do know that the values are passed by the form to this processing php page, so the error is not in there. In the DB I have encrypted all fields except 'company'- Thus, I want to see if this will work by trying to fetch the results back.</p>

<pre><code>// 1. Creating a new server connection

$db = new mysqli('localhost', 'root', '', 'developers');
if ($db-&gt;connect_errno) {
    printf("Connect failed: %s\n", $mysqli-&gt;connect_error);
    exit();
}
// 2, Creating statement object
$stmt = $db-&gt;stmt_init();

// 3, Creating a prepared statement
if($stmt-&gt;prepare("SELECT company FROM accesoweb WHERE username = AES_DECRYPT(?, 'salt')")) {

//4. Binding the variable to replace the ?
    $stmt-&gt;bind_param('s', $username);

    printf("Error: %d.\n", $stmt-&gt;errno);


// 5. Executing query
    $stmt-&gt;execute();


// 6. Binding the result columns to variables
    $stmt-&gt;bind_result($company); 


// 7. Fetching the result of the query
    while($stmt-&gt;fetch()) {
        echo $company; 
    }

// 8. Closing the statement object
   $stmt-&gt;close();

// 9. Closing the connection

 $mysqli-&gt;close(); 
</code></pre>

<h1>    }</h1>

<p>The inserting code that I just included in the MySQL was:</p>

<pre><code>INSERT INTO accesoweb (company, username,email,password)
VALUES
 ('hola',
AES_ENCRYPT('maria','salt'),
AES_ENCRYPT('sumail','salt'),
AES_ENCRYPT('password',' salt')


);
</code></pre>

<p>So, that row above(actually, the "company" is what I am trying to recover through the PHP code</p>
