Bladephp: Now with 7+ codeigniter, php, and laravel project 7+ php project From $18/Year From Rs. 1000/Year

How to get maximum value in mysql table column using Codeigniter

by
Category:codeigniter
codeigniter mysql
How to get maximum value in mysql table column using Codeigniter

Codeigniter provides select_max method to get maximum value in mysql table column. Writes a SELECT MAX(field) portion for your query. You can optionally include a second parameter to rename the resulting field.

Let’s create a select_max method in codeigniter

$this->db->select_max('amount');
$result = $this->db->get('tbl_product')->row();  
return $result->amount;

0 Comments


Html code work in comment box


Related Post