我有以下ajax调用
var prev_sibling = $(this).prev().attr("value");
var next_sibling = $(this).next().attr("value");
var order = (prev_sibling + next_sibling)/2;
var data = {PID:element_id, TGID:parent_id, ORD:order};
$.ajax({
type: "POST",
data: data,
url:"{{ path('v2_pm_patents_dragpatents') }}",
cache: false
});
在我的行动中,我得到了订单并像这样设置它
$order = $request->get('ORD');
$patent->setOrder($order);
但是ajax调用给了我以下错误
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 'order = '750' WHERE id = '0d0c0810-bc75-11e1-96a5-9787dec335c2'' at line 1 (500 Internal Server Error)
我正确地获取了发布数据,并且为我提供这些记录的查询也可以正常工作。
问题出在哪里?
有任何想法吗?
提前致谢