public function data()
{ 
if($old != $status || $prev_lat != $lat || $prev_long != $long)
            {
                if($status == 'Village' || 'Unknown')
                {
                    exec_query();
                }
                else if($status == 'Town' || 'City')
                {
                    exec_query();
                }   
            }
}
public function exec_query()
{
    //Some data;
}
But whenever i call this function i get error like:-
Call to undefined function exec_query() 
Can anyone tell me hw to call a function in cakephp
Add $this-> before the name of the function like this:
public function data()
{ 
if($old != $status || $prev_lat != $lat || $prev_long != $long)
            {
                if($status == 'Village' || 'Unknown')
                {
                    $this->exec_query();
                }
                else if($status == 'Town' || 'City')
                {
                    $this->exec_query();
                }   
            }
}
public function exec_query()
{
    //Some data;
}
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With