![]() |
Migrating CI3 to CI4, need query->numRows function - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Migrating CI3 to CI4, need query->numRows function (/showthread.php?tid=78294) Pages:
1
2
|
RE: Migrating CI3 to CI4, need query->numRows function - MGatner - 01-25-2021 For the record a simple way to extend the Database classes is to create your own driver, which can extend any current driver with whatever modifications you need. For example you could create app/Database/MyDriver/Connection.php with: PHP Code: class Connection extends \CodeIgniter\Database\MySQLi\Connection PHP Code: /** Your driver needs to support every class (see the list here https://github.com/codeigniter4/CodeIgniter4/tree/develop/system/Database/MySQLi) but they can be empty class extensions or even just class aliases. You can see my class alias approach for my WordPress database driver, which is a simple extension of the core MySQLi: https://github.com/tattersoftware/codeigniter4-wordpress/blob/develop/src/Database/Connection.php RE: Migrating CI3 to CI4, need query->numRows function - plaztic - 01-25-2021 You can create a helper for ease of use: Code: if (!function_exists('numRows')) |