How to access a specific column value from a single row after using CodeIgniter's get() query builder method
11:44 14 Jan 2012

I want to access the contents of a column called "email" in the database "tga_purchase_items" where the "id" of the row is "14". I want to save the output to a variable "$sp_email".

The code I have is thus:

$sp_email = $this->db
    ->select("email")
    ->from("tga_purchase_items")
    ->where("id", 14)
    ->get();

The variable is coming out empty although the database field is definitely populated.

What am I doing wrong? I am not familiar with "->" syntax at all.

php codeigniter resultset