db->insert" not documented on ModX site. created custom MySQL but no joy"> db->insert" not documented on ModX site. created custom MySQL but no joy" />
We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30884
    • 142 Posts
    Hi there

    Using 0.95 btw.
    I’m attempting to implement a ’custom’ modx set of tables which deal with credits and the likes.
    I’ve added them alongside the existing Modx_ set of tables but when I try to insert data into them
    I get the follow reported back.

    Fatal error: Call to a member function insert() on a non-object in E:\Apache2\htdocs\cms_tests\assets\snippets\CreditSystem\credits.php on line 29

    Am I missing something? The code making the call is an include being called from a snippet and operates fine otherwise until I use the
    $modx->db->insert

    Cheers!

    TXRX
      p i x e l p u s h e r e x t r o d i n a i r e
      A x i s A n i m a t i o n . c o m
      • 22303 MODX Staff
      • 10,725 Posts
      Without seeing the code in context, it’s gonna be mighty hard to help with this one...
        • 30884
        • 142 Posts
        got it sussed. I was over complicating the MySQL definitions and using the $modx->db->Insert dbapi wrongly. I’ve got it working at basic level just now but now I understand how to use it properly and look forward to filling my project credit system with loads of lovely data!

        That is one nice API btw. Sooo useful!
          p i x e l p u s h e r e x t r o d i n a i r e
          A x i s A n i m a t i o n . c o m