hi,
i have problem to update element, it is my javascript code
if(seconds_left < 0.00 && seconds_left > -1) {
$.ajax({
url: "https://TEST:8080/invo/index/timerupdate",
type: "POST",
data: {id: 66},
success: function(data){
}
});
}
controller code:
default type = 1
public function timerupdateAction() {
if ($this->request->isAjax()) {
$id = $this->request->getPost('id', 'int');
$sql = "UPDATE Videos SET type=0 WHERE id='".$id."'";
$query = $this->modelsManager->createQuery($sql);
$items = $query->execute();
$this->view->disable();
}
}
public function timerupdateAction() {
if ($this->request->isAjax()) {
$id = $this->request->getPost('id', 'int');
$sql = "UPDATE Videos SET type=0 WHERE id='".$id."'";
echo $sql;
$query = $this->modelsManager->createQuery($sql);
$items = $query->execute();
$this->view->disable();
}
}
and this sql code "UPDATE Videos SET type=0 WHERE id='66'" working in phpmyadmin
Idea?