Answers for "codeigniter db query builder"

PHP
0

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);
Posted by: Guest on January-20-2021
0

codeigniter 3 update

$data = array(
        'title' => $title,
        'name' => $name,
        'date' => $date
);

$this->db->where('id', $id);
$this->db->update('mytable', $data);
Posted by: Guest on November-06-2020
1

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'
Posted by: Guest on October-05-2020
-1

codeigniter 4 query builder select

$builder->select('title, content, date');
$query = $builder->get();

// Executes: SELECT title, content, date FROM mytable
Posted by: Guest on December-16-2020

Code answers related to "codeigniter db query builder"

Browse Popular Code Answers by Language