Answers for "codeigniter model limit"

0

codeigniter 3 limit

// Produces: LIMIT 20, 10 (in MySQL.  Other databases have slightly different syntax)
$this->db->limit(10, 20);  
$this->db->limit(10);  // Produces: LIMIT 10
Posted by: Guest on September-04-2021
-2

codeigniter select for update

$table = "my_table";
$id = 1;
$update = ["status"=>"working"];
//Edit just above / if you don't need extra "where" clause
$query = $this->db->select()
            ->from($table)
            ->where('id', $id)
            ->get_compiled_select();
$data = $this->db->query("$query FOR UPDATE")->row_array();
$this->db->where('id', $data['id'])->update($table,$update);
Posted by: Guest on October-02-2020

Browse Popular Code Answers by Language