I want to compare two values in where condition by codeigniter query.
Please help me as soon is possible.
<?php
$This->db->select('$a');
$This->db->where('a',$a and 'b','$b');
$This->db->from('tab');
$get = $this->db->get();
?>
<?php
$This->db->select('$a');
$cond = array(
'a'=> $a,
'b'=>$b
);
$This->db->where($cond);
$This->db->from('tab');
$get = $this->db->get();
?>
when you want to more than one condition in where clause you have to use associative array as per codeigniter active class refer the codeigniter docs for more information.