我正在从数据库中进行选择,并且数据成功返回。我只是不确定如何访问数组的元素,例如用户名或名称等。这是输出:
Array ( [0] => stdClass Object ( [id] => 9 [fullname] => خالد الغاÙ...دي [membership] => free [username] = > kkkkk [密码] => 16d7a4fca7442dda3ad93c9a726597e4 [电子邮件] => someone@gmail.com [关于] => [城市] => 利雅得 [profilepic] => /home2/sdds/public_html/uploads/Red_velvet_cupcakes_with_roses.jpgRed_velvet_cupcakes_with_roses.jpg [mobile ] => [电话] => [地址] => [画廊链接] => ) )
这是模型中返回上述内容的代码:
public function login()
{
$this->db->select('*');
$this->db->from('members');
$this->db->where('username', $this->input->post('username'));
$this->db->where('password', md5($this->input->post('password')));
$query = $this->db->get();
return $query->result();
}
那么在这里做什么呢?提前致谢