php - Get the value of a cell in mysql table -


i'm using codeigniter write few lines of simple code value mysql table.

what i've tried:

$interview_id=45 $category_raw = $this->db->query("select category interview interview_id='$interview_id'"); $category = $category_raw->first_row();  

but reason, $category shown "array()", while want value within.

any advice on how proceed?

thanks much,

try

$interview_id=45; $category_raw = $this->db->query("select category interview interview_id=$interview_id"); $category = $category_raw->first_row()->category;  

or active record

$interview_id=45; $this->db->select("category"); $this->db->where("interview_id",$interview_id); $category_raw = $this->db->get("interview"); $category = $category_raw->first_row()->category;  

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -