Thinkphp-"case error" caused "database table not found"

Data table M method, pay attention to case, otherwise the table cannot be found

I built two tables today. When using the data table, I found that if there are capital letters in them, ThinkPhp will automatically add "_", and then the table does not exist. The details are as follows:
Database table name: base_dbinfo, dbmgr_tbs
If you write lowercase in the controller.class.php file, no error will be reported.

public function add(){
    
    
        $dbInfo = M('base_dbinfo');
        var_dump($dbInfo);
     }

Write picture description here

But if it is written as follows, the table will not be found:

public function add(){
    
    
        $dbInfo = M('dbmgr_dbInfo'); --->dbInfo其中的I是大写
        var_dump($dbInfo);
    }

Write picture description here

Attention later! ! !

Guess you like

Origin blog.csdn.net/coolhe21cn/article/details/74186179