how to print mysql query of codeigniter query builder
To display the query string:
print_r($this->db->last_query());
To display the query result:
print_r($query);
how to print mysql query of codeigniter query builder
To display the query string:
print_r($this->db->last_query());
To display the query result:
print_r($query);
codeigniter 3 update
$data = array(
'title' => $title,
'name' => $name,
'date' => $date
);
$this->db->where('id', $id);
$this->db->update('mytable', $data);
where group codeigniter
$this->db->select('*')->from('my_table')
->group_start()
->where('a', 'a')
->or_group_start()
->where('b', 'b')
->where('c', 'c')
->group_end()
->group_end()
->where('d', 'd')
->get();
// Generates:
// SELECT * FROM (`my_table`) WHERE ( `a` = 'a' OR ( `b` = 'b' AND `c` = 'c' ) ) AND `d` = 'd'
codeigniter 4 query builder select
$builder->select('title, content, date');
$query = $builder->get();
// Executes: SELECT title, content, date FROM mytable
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us