Here is my class Connection in class1.php page
class Connection{
   //my other functions
   public function insert_data()
     {
         //my code
     } 
}
Here is my another class mydata in class2.php page
include('class1.php');
$ob=new Connection(); //first class object
class mydata
    {
       //my other functions
       $ob->insert_data();//my query passes through this insert_data()
    }
It returns an error : Fatal error: Call to a member function insert_data() on a non-object in //page link 
What is the problem in my code?
 Help me please 
