简体   繁体   中英

CakePHP Error: SQLSTATE[42S02] table not found - but exist

You might read this question every day so i tried another Stackoverflow's answer before asking:

CakePHP table is missing even when it exists

Anyways. The table i try to select data from does exist (quadra-checked uppercase/lowercase!) and it gets also listed via $db->->listSources() .


Here's a screenshot of the query, the message and the last result from listing all Datasource's tables:

http://i.stack.imgur.com/CdhcV.png


Note: If i run this query in PHPMyAdmin manually it works fine. I would say its impossible to get the pictures output at one time in a view - now its up to you to tell me the opposite. By the way: I am pretty sure to use the correct Datasource.

I should tell additionally that the mysql-server is hosted on another platform. Since i can use it for my localhost-phpmyadmin if i modify the config.inc.php i can promise it is no Firewall-Problem.

Written in behalf of xcy7e:

The mistake was to execute the Query from the local Model. Here's the code:

$conn = ConnectionManager::getDataSource('myDB'); 
$conn->query($query); 
// instead of $this->query($query);

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