私のアプリケーションでzend framework 2を使用しています。私はZF2のSQLクエリ構文エラー
$sql = "INSERT INTO tbl_group(group_name, group_order, version_id_fk, group_code)
SELECT group_name, group_order, {$newVersionId}, $this->getServiceLocator()->get('commonService')->randomMD5() FROM tbl_group
WHERE version_id_fk = {$versionArray['version_id_pk']}";
...単純にこのクエリを実行するしかし、私はこのエラーを取得しています:
SQLSTATE[42000]: Syntax error or access violation: 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 ')->get('commonService')->randomMD5() FROM tbl_group WHERE version_id_fk ' at line 2
誰もがこの問題を解決する方法を私に示唆することはできますか?
ありがとうございました!
あなたは ''があります。 {RAND()}) 'を実行します。もちろんそれは解析できません –