Skip to content

Instantly share code, notes, and snippets.

View arifulhb's full-sized avatar

Ariful Haque arifulhb

View GitHub Profile
@arifulhb
arifulhb / getTotalNum
Created December 29, 2014 09:19
Get Total Row Numbers
public function getTotalNum(){
$this->db->select('mrcnt_sn');
$this->db->from('tblmerchant');
$res=$this->db->get();
return $res->num_rows;
}//end function
@arifulhb
arifulhb / getTotalSearchNum
Created December 29, 2014 09:14
Get total number of records based on keyword and search_by item.
public function getTotalSearchNum($keyword, $search_by){
$sql='SELECT cust_sn ';
$sql.='FROM (avcd_customer AS c) ';
switch ($search_by):
case 'name':
$sql.='WHERE c.cust_first_name LIKE "%'.$keyword.'%" OR c.cust_last_name LIKE"%'.$keyword.'%" ';