我正在使用MySQL与Zend Framework和Doctrine 2.我认为即使你不使用Doctrine 2,你也会熟悉像
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 'ASC' at line 1
问题是我没有看到完整的查询.没有ORM框架,我可能很容易回应sql,但是使用框架,我怎样才能找到它试图执行的SQL?我把错误缩小到了
$progress = $task->getProgress();
Run Code Online (Sandbox Code Playgroud)
$progress
被宣布
// Application\Models\Task
/**
* @OneToMany(targetEntity="TaskProgress", mappedBy="task")
* @OrderBy({"seq" = "ASC"})
*/
protected $progress;
Run Code Online (Sandbox Code Playgroud)
在MySQL中,任务类看起来像
CREATE TABLE `tasks` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`owner_id` int(11) DEFAULT NULL,
`assigned_id` int(11) DEFAULT NULL,
`list_id` int(11) DEFAULT …
Run Code Online (Sandbox Code Playgroud)