У меня есть запрос вставки, но он работает как обновлениеторт PHP вставить запрос работает, как обновление
контроллер
public function home()
{
$this->loadModel("Ratings");
$aaddRatings = $this->Ratings->addRatings($this->data['id'],$this->data['searches'],$this->data['name'],$this->data['email'],$this->data['review'],$this->data['rating']);
$this->set(compact('aaddRatings'));
}
Модель
public function addRatings($id,$searches,$name,$email,$review,$rating)
{
$this->create();
$aaddRatings =$this->save(array('id'=>$id,'searches'=>$searches,'name'=>$name,'email' => $email,'review' => $review,'rating' => $rating));
return($aaddRatings);
}
Debug
SELECT COUNT(*) AS `count` FROM `milgyonu_mber`.`ratings` AS `Ratings` WHERE `Ratings`.`id` = '19' 1 1 1
2 SELECT COUNT(*) AS `count` FROM `milgyonu_mber`.`ratings` AS `Ratings` WHERE `Ratings`.`id` = '19' 1 1 1
3 SELECT COUNT(*) AS `count` FROM `milgyonu_mber`.`ratings` AS `Ratings` WHERE `Ratings`.`id` = '19' 1 1 1
4 UPDATE `milgyonu_mber`.`ratings` SET `action` = 'NO', `id` = '19', `searches` = 'Advanced Neurology & Super Speciality Hospital', `name` = 'shyam', `email` = '[email protected]', `review` = 'test msg', `rating` = '2' WHERE `milgyonu_mber`.`ratings`.`id` = '19'
мог вы печатаете сценарий «save», чтобы иметь возможность анализировать запрос «вставить»? Потому что если вы проверите свою консоль 4 отладки, будет обновление, а не вставка. – gabriel