Question: How to convert this query to codeingniter framework:

```
SELECT sname FROM alumni WHERE email IN (SELECT * FROM alumni_user WHERE uname = '')

```

Answer: 
Try this one..

```
$this->db->select('*');

$this->db->from('alumni_user');

$this->db->where('uname','');

$result = $this->db->get();

```
Try this one:

```
$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 '';
}

```