Case-sensitive Thinkphp database table names

Source: Internet
Author: User
Thinkphp database table names are case sensitive. this is my controller code.
 select();        var_dump($a);        die;        $this->display();    }}

This is an error:
1146: Table 'movierdc. praise 'doesn' t exist [SQL statement]: SHOW COLUMNS FROM 'Praise'
Declare that my table name is correct. there is a table in all lower case in the database, and the query is normal. The first letter cannot be capitalized.

The following are methods that have been tried and are useless:
'Db _ PARAMS '=> array (\ PDO: ATTR_CASE => \ PDO: CASE_NATURAL ),

Have you encountered a similar problem? how can this problem be solved? Job search!


Reply to discussion (solution)

No problem in windows
Linux is hard to say.

'Db _ PARAMS '=> array (\ PDO: ATTR_CASE => \ PDO: CASE_NATURAL ),

'Db _ PARAMS '=> array (\ PDO: ATTR_CASE => \ PDO: CASE_NATURAL ),
This configuration makes the field names case insensitive. The table name is invalid.

I read the source code by myself. this is thinkphp which converts all table names to lowercase by default, opens them in uppercase, connects them with _, and changes them to lowercase.
I cannot find the configuration item about the configuration table name. So I started with the source code and removed the function that converts the code to lowercase, and removed the function that splits and reassembles the code. Finally, it can be used.

After so long, I posted my post on CSDN!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.