私はCakePHPgoogle-groupでこの質問をしましたが、解決策が見つからなかったので、うまくいけばここで幸運が訪れるでしょう。
私はCakePHPで少し開発を続けており、インターネット接続に依存せずにアプリを人々にデモできるように、MAMPにローカルホストバージョンを用意することにしました。
いくつかの複雑なMySQLクエリが作成され、使用されています
$this->query('SELECT...');
これらを関数内の適切なモデルに配置して、このすべてのロジックをコントローラーから削除しました。したがって、コントローラーからは次のようなものがあります
$this->Users->getMeSomething($variable);
、それはuser.phpモデルに行き、その関数を実行します。これはライブサイトと開発サイトでは正常に機能しますが、MAMPでは、呼び出しの1つの例として、このタイプの呼び出しが行われるたびにエラーが発生します。
エラー:
Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the
right syntax to use near '__getUsersForUsers' at line 1 [CORE/cake/
libs/model/datasources/dbo_source.php, line 525]
コンテクスト:
DboSource::showQuery() - CORE/cake/libs/model/datasources/
dbo_source.php, line 525
DboSource::execute() - CORE/cake/libs/model/datasources/
dbo_source.php, line 201
DboSource::fetchAll() - CORE/cake/libs/model/datasources/
dbo_source.php, line 336
DboSource::query() - CORE/cake/libs/model/datasources/dbo_source.php,
line 297
Model::call__() - CORE/cake/libs/model/model.php, line 441
Overloadable::__call() - CORE/cake/libs/overloadable_php5.php, line 52
AppModel::__getUsersForUsers() - [internal], line ??
UsersController::view() - APP/controllers/users_controller.php, line
401
Object::dispatchMethod() - CORE/cake/libs/object.php, line 118
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 227
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 194
[main] - APP/webroot/index.php, line 88
webrootの88行目は次のとおりです。$Dispatcher->dispatch($ url);
私はCakePHPの1.2と1.2.5の両方を試しました。MAMP上のMySQLは5.1.31であり、私のホストであるMediaTempleは5.1.26-rcです。
助けてくれてありがとう