[3.7.4] Falang database driver can't handle ->select('1') #17003
The following piece of code works differently in PHP 7 and PHP 5:
$mysqli = mysqli_connect("localhost", "root", "", "mydatabase"); $res = mysqli_query($mysqli, "select 1"); $row = mysqli_fetch_object($res); var_dump($row);
In PHP 7 it will dump
but in PHP 5
Therefore I think the PR is motivated. Maybe it can be changed to
To complete this case.
Joomla don't see the problem because the loadResult work fine with select('1) but the loadObject don't work fine.
There are 2 file to change and replace for the check method
libraries/joomla/table/nested.php line 694
libraries/joomla/table/nested.php line 997
did'nt experienced php 5 vs php 7 different behaviour
..despite i think should be fixed on falang side...
With mysqli_fetch_row it's work but in Joomla if you change in the assets.php check method
if ($this->_db->setQuery($query, 0, 1)->loadResult())
Falang use loadobject for all it's why there are a problem since the last Joomla version.
the change of the query
fix the problem on falang , it's not a Joomla bug because Joomla use loadResult.
look at the @olleharstedt message and try this
$mysqli = mysqli_connect("localhost", "root", "", "mydatabase");
The result is not the same with an empty object for php 5