How to convert an Object to array in php with framework Codeigniter
11:30 25 Jun 2018

I trying to query in database, and the result is an Object. I want to show that result but $response always Null in my show.php. I using CodeIgniter

My Controller

home.php

class Home extends CI_Controller{
public function _contruct(){

    parent::_contruct();
}
public function index(){
    $this->load->view("from.html");
}
public function findID(){

    $this->load->database();
    $this->load->helper('url');
    $id = $this->input->post("findId"); 
    $sql="SELECT * FROM cli_articles WHERE ID='{$id}'";
    $response=$this->db->query($sql);  
    //$row=$response->row();
   // echo $row->name;
    $this->load->view("show",$response);
}
}
?>

My view

from.html

 



From

and show.php


    

id :

category_id :

content :

created :

description :

image :

mt_description :

mt_keyword :

name :

ngay_dang :

order :

slug :

status :

view :

anh i don't know why $show_db=mysql_fetch_array($response) not correct Thank for your help!

php codeigniter model-view-controller resultset