Results 1 to 4 of 4

Thread: [3.x SOLVED] Fatal Error: Database execute() not working

  1. #1
    Experienced user
    Join Date
    06-11-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default [3.x SOLVED] Fatal Error: Database execute() not working

    I'm doing this piece of code below in FormAuto.php and I'm converting it to 3.x, however I've run into a number of issues. This error keeps coming up:

    Code:
    Fatal error: Call to a member function execute() on a non-object in /home/eventfgp/public_html/system/modules/formauto/classes/FormAuto.php on line 797
    Line 797 is:
    Code:
    $objRow = $this->Database->execute("SELECT " . join(',',array_keys($fields)). " FROM " . $arrForm['storeTable']. " ORDER by tstamp");
    Any ideas?

  2. #2
    Experienced user
    Join Date
    06-11-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: [3.x] Fatal Error: Database execute() not working

    I found the problem. LOL. The Database object is no longer available in the Frontend. You have to switch all your routines to \Model which will return a database result.

  3. #3
    New user
    Join Date
    12-27-12.
    Posts
    16

    Default Re: [3.x SOLVED] Fatal Error: Database execute() not working

    Hello thyon,

    I'm also trying to upgrade myself on the v3 of contao module. I'm using the \MyModel::findAll(); but the query is empty. What is very strange is that I can copy past the query "Select * tl_my_table..." inside the query object (result of \MyModel::findAll()) and if I run it from phpMyAdmin, I got results!

    What can be wrong?

    Thanks

    David

  4. #4
    New user
    Join Date
    12-27-12.
    Posts
    16

    Default Re: [3.x SOLVED] Fatal Error: Database execute() not working

    hello,

    I found it. When the query is an object the debugger still say that's empty, but when I parse it into an array this is ok.

    Thanks

    David

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •