database - Query execution in codeigniter -


i have situation need fetch details of employee database using id , display them in browser.

$sql = "select * employeesalarypayment empid = ".$val['empid'].";";

$query = $this->db->query($sql);

these statements have written result array. problem how take single field/column array? have done correctly?

thanks in advance.

if query return single data database need use

$row = $query->row_array()  

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -