Bladephp: Now with 8+ codeigniter, php, and laravel project 8+ php project From $37/Month From Rs. 2499/Month

How to use get_where in Codeigniter

by
Category:codeigniter
codeigniter
How to use get_where in Codeigniter

Codigniter $this->db->get_where() allows you to create a sql slect query having the WHERE Clause.

$table_name – Your table name.

$where_array – Array which generates the condition.

$limit – no of records to be loaded.

$offset – start of limit.

Syntax

$query = $this->db->get_where($table_name,$where_array, $limit, $offset);

Example

$role_id = 2;
$role = $this->db->get_where('user_roles', array('id' => $role_id))->row()->name;

0 Comments


Html code work in comment box


Related Post