irsyadulibad / ci4-datatables

Server Side Datatables Library for CodeIgniter 4 Framework
https://ci4-datatables.netlify.app
MIT License
72 stars 32 forks source link

column not found in the new Codeigniter version 4.1.5 #17

Open seunex17 opened 2 years ago

seunex17 commented 2 years ago

Am using this package in my project and it working perfectly in my CodeIgniter v4.1.4 but after upgrading to v4.1.5 there is now error say 'column not fund'

The issue observe is trying to create the db_prefix multiple times.

ERROR - 2021-11-19 03:10:21 --> Unknown column 'zd_`zd_users.user_username' in 'where clause'
CRITICAL - 2021-11-19 03:10:21 --> Unknown column 'zd_`zd_users.user_username' in 'where clause'
#0 C:\xampp\htdocs\clients\occidoma\vendor\codeigniter4\framework\system\Database\MySQLi\Connection.php(292): mysqli->query('SELECT COUNT(*)...', 0)
#1 C:\xampp\htdocs\clients\occidoma\vendor\codeigniter4\framework\system\Database\BaseConnection.php(670): CodeIgniter\Database\MySQLi\Connection->execute('SELECT COUNT(*)...')
#2 C:\xampp\htdocs\clients\occidoma\vendor\codeigniter4\framework\system\Database\BaseConnection.php(598): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT COUNT(*)...')
#3 C:\xampp\htdocs\clients\occidoma\vendor\codeigniter4\framework\system\Database\BaseBuilder.php(1527): CodeIgniter\Database\BaseConnection->query('SELECT COUNT(*)...', Array, false)
#4 C:\xampp\htdocs\clients\occidoma\vendor\irsyadulibad\codeigniter4-datatables\src\TableProcessor.php(35): CodeIgniter\Database\BaseBuilder->countAllResults(false)
#5 C:\xampp\htdocs\clients\occidoma\vendor\irsyadulibad\codeigniter4-datatables\src\DataTableMethods.php(101): Irsyadulibad\DataTables\TableProcessor->count()
#6 C:\xampp\htdocs\clients\occidoma\vendor\irsyadulibad\codeigniter4-datatables\src\TableProcessor.php(42): Irsyadulibad\DataTables\DataTableMethods->filterRecords()
#7 C:\xampp\htdocs\clients\occidoma\vendor\irsyadulibad\codeigniter4-datatables\src\TableProcessor.php(27): Irsyadulibad\DataTables\TableProcessor->doQuery()
#8 C:\xampp\htdocs\clients\occidoma\app\Controllers\Admin\AccountController.php(332): Irsyadulibad\DataTables\TableProcessor->make()
#9 C:\xampp\htdocs\clients\occidoma\vendor\codeigniter4\framework\system\CodeIgniter.php(824): App\Controllers\Admin\AccountController->ajaxListStaffAccount()
#10 C:\xampp\htdocs\clients\occidoma\vendor\codeigniter4\framework\system\CodeIgniter.php(410): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Admin\AccountController))
#11 C:\xampp\htdocs\clients\occidoma\vendor\codeigniter4\framework\system\CodeIgniter.php(318): CodeIgniter\CodeIgniter->handleRequest(NULL, Object(Config\Cache), false)
#12 C:\xampp\htdocs\clients\occidoma\public\index.php(37): CodeIgniter\CodeIgniter->run()
#13 {main}

How can i fix this please i have fork the repo to reproduce this issue.

irsyadulibad commented 2 years ago

Hello, I've tried it, and it works fine on codeigniter v4.1.5 image code

seunex17 commented 2 years ago

Do you use db prefix on your end? Am using db prefix