本文整理汇总了PHP中Items::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Items::update方法的具体用法?PHP Items::update怎么用?PHP Items::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Items
的用法示例。
在下文中一共展示了Items::update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
/**
* @name update
* @description update an item
* @param int $id
* @param string $name
* @return mixed
*/
private function update($id, $name)
{
$item = new Items();
if ($item->update($id, $name)) {
return $this->response('', 'Item has been updated', false);
}
return $this->response('', "Could not update the item {$id}", true);
}
示例2: json_encode
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
// load the items class
require_once '../classes/concertClass.php';
$response = array('error' => true, 'message' => '');
if (isset($_POST['id']) && isset($_POST['name'])) {
$id = $_POST['id'];
$name = $_POST['name'];
$items = new Items();
// update the item
if ($items->update($id, $name)) {
$response['error'] = false;
$response['message'] = 'Item has been updated';
} else {
$response['message'] = 'Could not update the item';
}
} else {
$response['message'] = 'Missing id value';
}
// json response
echo json_encode($response);
示例3: elseif
$upError[] = "Type not found";
} elseif (strlen($upTitle) < 1) {
$upError[] = "enter title";
} elseif (strlen($upGenre) < 1) {
$upError[] = "enter genre";
} elseif (strlen($upDescription) < 1) {
$upError[] = "enter description";
} elseif (strlen($upPrice) < 1) {
$upError[] = "enter price";
} elseif (strlen($upRP) < 1) {
$upError[] = "enter rentperiod";
} elseif (!isset($upStatus)) {
$upError[] = "status not found";
} else {
$upI = new Items($upType, $upNo, $upTitle, $upGenre, $upDescription, $upPrice, $upRP, $upStatus);
$upI->update();
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<title>Inventory</title>