Closed daza110 closed 1 year ago
$NoTasks` = $db->num_rows;s
There is no direct access to any protect method property.
This package really based on the additional shortcut methods. That takes of prepared statements and sql escaping.
I don't see any connection setup, need more info and full
OK, I have migrated to a new server and whilst doing so decided to use composer to install ezsql. We were using v3.08 which was not installed via composer on the old server.
That allowed $db->num_rows so an awful lot of our scripts and code has this in, which has effectively broke our system.
So as this is a newer version, is there something I have to do now? EG I noticed that $db->debug(); had stopped working too. Until I saw that we now need to declare $db->debugOn();
However I cant see anywhere on the docs which referd to num_rows.
Im not sure what other info you want sorry.
This is how I connect to my DB
$db = Database::initialize('mysqli',[_DUSER,_DPASSWORD,_DATABASE,_DHOST],'db');
PHP Version: 7.4 Debian 11
All the property are accessible by a magic method routine.
There are no underscore in property names, now camelCase, so call by getNumRows().
Anyway you should read branch 4x readme, a whole lot of breaking changes.
So there is non work around then? I have to go through and change all of my $db->num_rows to $db->getNumRows()
I'll take a look then.
Yes
OK if anyone else comes across this issue I did a global update with the following command to batch update this:
grep -rl '$db->num_rows' /path/to/folder | xargs sed -i s@'$db->num_rows'@'$db->getNumRows()'@g
This echos: "Number of Tasks to start: " It does not say many rows there are.
ezSQL version 5.1.1 installed via composer so its the latest version