Retrieving data from database using prepared statement
<p>I'm having problem retrieving my data from my database. Here's my code:</p>

<pre><code>function login($email, $password) {
    $stmt = $this-&gt;conn-&gt;prepare("SELECT id FROM lms_admin_users WHERE email=?");
    $stmt-&gt;bind_param('s', $email);
    $stmt-&gt;execute();
    $stmt-&gt;store_result();
    if($stmt-&gt;num_rows == 1) {
        while ($stmt-&gt;fetch()) {
            // echo data from table like $data["name"]; &lt;----
        }
    }
    else {
        echo "Failed";
    }
}
</code></pre>

<p>What I want to know is the equivalent of <code>while($data=mysqli_fetch_assoc($result))</code> to replace my existing code (in OOP way) <code>while ($stmt-&gt;fetch())</code> and make it fetch the datas using <code>$data["name"]</code></p>