Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
DB::count_last_query() throws an error
Following last update, we now see another issue:
Fuel\Core\PhpErrorException [ Notice ]:
Trying to get property of non-object
/classes/database/connection.php @ line 390
Shouldnt that line be just :
return (int) $result->get('total_rows');
After investigating this a little bit deeper I've found this:
echo \DB::count_last_query(); // returns 21 as a correct result
echo \DB::count_last_query(); // returns 1 as the count query was the last executed one
The question is : is that expected behavior or it should not replace context of initial query ?
That is expected behaviour, the DBAL doesn't know where queries come from, it just uses the last one.
What about that error at line 390 ?
I have to look at it.
Also count_last_query() no longer resets the "last query" in the system, so the expected behaviour is now also a more logical behaviour.
Found another issue, so more updates are coming...
And also fixed.
Add a Comment
It looks like you're new here. If you want to get involved, click one of these buttons!
Apply for Membership
↳ Job Board
↳ Installation & Setup
↳ Tips and Tutorials
↳ Code share
In this Discussion