0

I have some code in my application:

    $dmMain->tblOrgList->append();

This code written with auto-completion, so everything is correct. But, when I trying to execute this code, I have error:

Fatal error: Call to a member function append() on a non-object in C:\Users\ASAP\Documents\HTML5 Builder\Projects\VitoOrgList\index.php on line 18

Can somebody advice, where I can find a trouble? Thanks

Andrey
  • 2,659
  • 4
  • 29
  • 54
  • Have you tried var_dump($dmMain->tblOrgList) right before your function call to see what the non-object has? Maybe var_dump($dmMain). – Gallaecio Feb 01 '13 at 08:36
  • Yes, $dmMain is NULL. What should I change? datamodule.inc included at the top of mys source file. – Andrey Feb 05 '13 at 12:54

1 Answers1

0

I found the solution. Really, I have no big PHP experience :-]

I just added before calling $dmMain methods in function body:

 global $dmMain;
Andrey
  • 2,659
  • 4
  • 29
  • 54