I have a simple CodeIgniter Active record query to select an ID:
$q = $this -> db -> select(\'id\') -> where(\'email\', $email
one short way would be
$id = $this -> db -> select('id') -> where('email', $email) -> limit(1) -> get('users') -> row() ->id; echo "ID is ".$id;