Category : codeigniter-3

I want to display data in different sections, but error when I run. enter image description here Controller class Dfkamar extends CI_Controller { public function index() { $data[‘tamu’] = $this ->m_tamu->daftar_kamar()->result(); $this->load->view(‘templates/header’); $this->load->view(‘templates/sidebar’); $this->load->view(‘dfkamar’, $data); $this->load->view(‘templates/footer’); } View <?php foreach ($tamu as $tamu) : ?> <button type="button" class="btn btn-success"><?php echo $tamu->gateA ?></button> </div> <?php endforeach;?> ..

Read more

I have a select query in Codeignter as below: $this->db->select("*"); $this->db->from("table_name"); $query = $this->db->get(); $data = $query->result(); In the table, there are two columns for timestamp, ‘created_at’ and ‘updated_at’, with a default format of YYYY-MM-DD hh:mm:ss. Now I want to return $data from function with modified timestamp format (DD-MM-YYYY hh:mm:ss) for each row and each ..

Read more

i have a codeigniter website where am trying to add data to another website using its api, my controller is like below: public function teamx(){ $data = array(); if($this->isUserLoggedIn){ $con = array( ‘id’ => $this->session->userdata(‘userId’) ); $this->load->view(‘teamx’, $data); } else{ redirect(‘login’); } } in the targets website they gave some details like below, URL https://portal.teamex.ae/webservice/CustomerBooking ..

Read more

output = Array ( [0] => Array ( [id] => 94 ) ) how to change it to Array ( [id] => 94 ) Here is My Model public $table = ‘category’; public function lastInsert() { $this->load->database(); $last = $this->db->select(‘id’)->order_by(‘id’,"desc")->limit(1)->get(‘category’)->result_array(); print_r($last); } And My Controller $last = $this->Model_category->lastInsert();die; I Use print_r and die to debug ..

Read more

I’m trying to create a custom driver in codeigniter, but i got error. here is the File hierarchy: /libraries /libraries/Taker /libraries/Taker/Taker.php /libraries/Taker/drivers /libraries/Taker/drivers/Taker_test.php Code in libraries/Taker/Taker.php: class Taker extends CI_Driver_Library { function hello() { echo 123; } } Code in libraries/Taker/drivers/Taker_test.php: class Taker_test extends CI_Driver { function world() { echo 123; } } The code ..

Read more