简体   繁体   中英

interal error with querybuilder of cakephp on Prod

I'm working under wamp with php 7.4.26 @windows. I have a project under cakephp. It works well on Dev Environnement.

I know what's wrong, but I don't know why this happens only on linux.

$users = TableRegistry::getTableLocator()->get('users');
$user = $users->find('all')->contain(['Products' => ['sort' => ['Products.id' => 'DESC']]])->first();

SELECT 
products.id AS `products__id`, 
products.name AS `products__name`

FROM products products 
ORDER BY Products.id DESC -- Products vs products!!

This seems not to be php related, but more likely coming from the SQL engine you use which is different under the WAMP context and the linux server. WAMP lets the user choose between MariaDB and MySQL, and it seems you don't mention which database engine is used on the linux side.

So, i think you should at first glance try to get the information about which SQL engine is used on the linux server, and then try to change the collation used for storing the table names. If you cannot change it, you will have to adapt your code to it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM