Sandeep Pariyar Sandeep Pariyar - 1 year ago 98
SQL Question

How to echo a value from select query in codeigniter

How do i get the value of id from the following query

$id = $this->db->query("SELECT id from tbl_profile_main WHERE token_='".$token."';");

Answer Source

Try:

$row = $id->row();
echo $row->id;