php - problem with camelcase field model in yii2
Get the solution ↓↓↓I built a project with Yii2 a year ago, I created more than ten models of the project, and the code has really expanded. My project worked well. And I had no problem.
This year, I had to transfer the database to another server.(connect remote to database) The new server has the following specifications:
new server:
server: 20.04.4
mysql: 8.0.21
php: 7.4.7
Previous server: server: 19.0.4
mysql: 5.7.28
php: 7.2.24
The problem is that the fields defined as CamelCase in the database are not identifiable in this project.
How can I use CamelCase fields in a project without renaming the fields in the database?
if I removed 'attributes' => [PDO::ATTR_CASE => PDO::CASE_LOWER], from db.php I get this error:
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: invalid argument supplied for foreach() laravel
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.