致命错误:未捕获的异常' Phalcon \ Mvc \ Model \ Exception'同 消息'语法错误,意外令牌>,靠近'限制:APL0:', 解析时:SELECT [Multiple \ Backend \ Models \ urunler]。* FROM [Multiple \ Backend \ Models \ urunler] WHERE urunNo =>限制:APL0:(111)' 在C:\ xampp \ htdocs \ BestShop \ apps \ backend \ models \ urunler.php:42 Stack 跟踪:#0 [内部函数]:Phalcon \ Mvc \ Model \ Query-> parse()#1 [内部函数]:Phalcon \ Mvc \ Model \ Query-> execute()#2 C:\ XAMPP \ htdocs中\ BestShop \应用\后端\模型\ urunler.php(42): Phalcon \ Mvc \ Model :: findFirst(Array)#3 C:\ XAMPP \ htdocs中\ BestShop \应用\后端\控制器\ UrunController.php(56): Multiple \ Backend \ Models \ urunler-> sil(NULL)#4 [内部函数]: 多个\后端\控制器\ UrunController-> silAction(' 125')#5 [内部函数]:Phalcon \ Dispatcher-> dispatch()#6 C:\ XAMPP \ htdocs中\ BestShop \公共\的index.php(98): Phalcon \ Mvc \ Application-> handle()#7 C:\ xampp \ htdocs \ BestShop \ public \ index.php(105):Application-> main()#8 抛出了{main} 第42行的C:\ xampp \ htdocs \ BestShop \ apps \ backend \ models \ urunler.php
模型
public function delete($id){
$product = products::findFirst(
array(
"conditions" =>"urunId => $id"
));
$product->delete($id);
}
控制器
public function deleteAction(){
$product = new products();
$product->delete($this->request->getPost('id'));
}
查看
<td>{{ link_to("admin/product/delete/" ~ detay.urunId, 'Delete') }}</td>
答案 0 :(得分:0)
public function delete($id){
$product = products::findFirst([
"conditions" =>"urunId = $id"
]
$product->delete($id);
}