[eluser]jegbagus[/eluser]
[quote author="AF" date="1251710269"]Could you give me a little more detail? Here is the code:
function datediff($sdate, $anchor) {
$query="SELECT DATEDIFF('$sdate','$anchor')";
$query =$this->db->query($query);
$row=$query->result_array();
return($row);
}
So, maybe this is a basic question, but what is the & in your case?
And, thank you too.[/quote]
hello af, & get_instance suppose to get instance that CI create when you fire a request. your library and everything that you call from load function will be at this instance. the code will be
Code:
function datediff($sdate, $anchor) {
$CI =& get_instance();
$query="SELECT DATEDIFF('$sdate','$anchor')";
$query =$CI->db->query($query);
$row=$query->result_array();
return($row);
}
but honestly, i think you should place this code at your library.
any other opinion?