Sandeep Pariyar Sandeep Pariyar - 6 months ago 26
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

Try:

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