Home » Php » php – mysql not accepting tablename as it is

php – mysql not accepting tablename as it is

Posted by: admin February 25, 2020 Leave a comment


i m working on a project that displays user, admin and superadmin panel and uses HMVC for functionality. The main problem here is that when i login through superadmin user, the data must be fetched from a table named ‘users’ but instead when the ‘users’ variable is passed in $this->load->model('user_model', 'users'); and if i run the project, it is showing DB error as

A Database Error Occurred
Error Number: 1146
Table 'interview_panel.user' doesn't exist
SELECT COUNT(*) AS `numrows` FROM `user`
Filename: D:/xampp/htdocs/ba-tool/system/database/DB_driver.php
Line Number: 691 

so basically problem is i m sending parameter as ‘users’ and the value passed is ‘user’ without “s” and the same problem is happening with another table in my DB that causes the whole project to stop. Neither i am able to find how the flow of project is working for db queries.

CI Bootstrap Version: Build 20170324, CI Version: 3.1.3

How to&Answers:

thanks, everyone for the help i found the issue. It was due to xampp version 7.3.9 and php installed along with it, then i installed xampp 7.2.26 and it resolved the issue, there some difference in configs of both php versions that causes this error