如何将此查询转换为codeigniter框架:
SELECT sname FROM alumni WHERE email IN (SELECT * FROM alumni_user WHERE uname = '')
答案 0 :(得分:1)
试试这个..
$this->db->select('*');
$this->db->from('alumni_user');
$this->db->where('uname','');
$result = $this->db->get();
答案 1 :(得分:0)
试试这个:
$q = $this->db->query("SELECT sname FROM alumni WHERE email IN (SELECT * FROM alumni_user WHERE uname = '')");
if($q->num_rows() > 0)
{
$data = $q->result_array();
print_r($data);
}
else
{
echo '';
}