Model all Querys

INSERT==>

function form($data)

{

$insert = $this->db->insert('form', $data);

}

 UPDATE==>

function update($id, $data)

    {

$this->db->where('id', $id);

$this->db->update('form', $data);

                $error = $this->db->error();

                if(empty($error['message'])) { return true; }

                else { return false; }

}

FETCH==>

public function fetch_data(){

$this->db->select('*');

$this->db->from('form');

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

return $query->result_array();

}

DELETE==>

public function del ($id

 {

$this->db->where('id',$id);

$insert = $this->db->delete('form');

return true;

}





Comments

Popular posts from this blog

condition in table data for html

my notepad code notes

React.js Notes