[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?
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.
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
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