<?php
$phql = "UPDATE Robots SET name = :name:, type = :type:, year = :year: WHERE id = :id:";
$status = $app->modelsManager->executeQuery(
$phql,
[
"id" => 100,
"name" => "Astroy Boy",
"type" => "mechanical",
"year" => 1959,
]
);
// Check if the update was successful
if ($status->success() === true) {
echo "OK";
}
返回结果的方法
Methods
public __construct (mixed $success, [Phalcon\Mvc\ModelInterface $model])
public getModel ()
Returns the model that executed the action
public getMessages ()
Returns the messages produced because of a failed operation
public success ()
Allows to check if the executed operation was successful
打印值
public function test(){
// $res = $this->modelsManager->executeQuery("delete from Front\Models\User_msg where user_id = " . $_SESSION['user_id'] . " and id in (" . $ids . ") ");
$res = $this->modelsManager->executeQuery("delete from Front\Models\Release_requir where id =889");
var_dump($res->getModel());
var_dump($res->getMessages());
var_dump($res->success());
die();
}
NULL
array(0) {
}
bool(true)