How to get query result with mysqli?
<p>I have this query in CodeIgniter:</p>

<pre><code>$user_data = $this-&gt;db
            -&gt;select('table_users.id AS user_id, table_users.email AS user_email, table_users.GUID as user_guid, '
                    . 'table_roles.slug AS role_slug, table_user_settings.username, table_users.id_roles, '
                    . 'table_users.first_name, table_users.last_name, table_users.mobile_number, table_users.phone_number, '
                    . 'table_users.address, table_users.city, table_users.state, table_users.zip_code, table_users.notes')
            -&gt;from('table_users')
            -&gt;where('table_users.data', 0)
            -&gt;join('table_roles', 'table_roles.id = table_users.id_roles', 'inner')
            -&gt;join('table_user_settings', 'table_user_settings.GUID = table_users.GUID')
            -&gt;where('table_user_settings.username', $username)
            -&gt;where('table_user_settings.password', $password)
            -&gt;get()-&gt;row_array();

    return ($user_data) ? $user_data : NULL;
</code></pre>

<p>I have write this code for convert it:</p>

<pre><code> if($stmt = $this-&gt;db-&gt;prepare("SELECT table_users.id AS user_id, table_users.email AS user_email, table_users.GUID as user_guid, "
        . "table_roles.slug AS role_slug, table_users.id_roles, table_users.first_name, "
        . "table_users.last_name, table_users.mobile_number, table_users.phone_number, "
        . "table_users.address, table_users.city, table_users.state, table_users.zip_code, table_users.notes "
        . "FROM table_users "
        . "INNER JOIN table_roles ON table_roles.id = table_users.id_roles "
        . "INNER JOIN table_user_settings ON table_user_settings.GUID = table_users.GUID "
        . "WHERE table_users.data = 0 AND "
        . "table_user_settings.username = ? AND "
        . "table_user_settings.password = ? "))
    {
        $stmt-&gt;bind_param("ss",$username, $password);
        $stmt-&gt;bind_result($id, $email, $GUID, $slug, $id_roles, $first_name, $last_name,
            $mobile_number, $phone_number, $address, $city, $state, $zip_code, $notes);
        $result = $stmt-&gt;execute();
        $stmt-&gt;fetch();
        var_dump($stmt);
    }

    $stmt-&gt;close();
    return $result;
</code></pre>

<p>but I can't return all variable in one array as the first code. 
In CodeIgniter I can get all result as array like ->get()->row_array(). But I can't do the same in mysqli, I just want return all the selected value of the query as array...
Someone could help me on this conversion?</p>