class - variable not recongnized PHP POO -


I have a file data.php with different classes and I need to call in other files.

  & lt ;? Php include_once ('data.php'); $ Db = new data manager (); // Class manager here {// $ db = new data manager ();  

Function savings data ($ ob) // obj {$ db.saveData ($ ob); // error unspecified variable $ db} -> Try with

  $ db- & gt; Savedata ($ ob);  

Additionally, you manager class function

  $ newobj = new from  $ ob  Will be manager (); $ Newobj- & gt; SavingData ($ ob);  

Comments