本文整理汇总了PHP中DBUtils::update方法的典型用法代码示例。如果您正苦于以下问题:PHP DBUtils::update方法的具体用法?PHP DBUtils::update怎么用?PHP DBUtils::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBUtils
的用法示例。
在下文中一共展示了DBUtils::update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updatePhoto
public static function updatePhoto($param)
{
$pdo = new DBUtils();
$sql = "update homepage set photoUrl = '" . $param['photoUrl'] . "' where id = '{$param['id']}'";
$rs = $pdo->update($sql);
return $rs;
}
示例2: edit_course_des
public static function edit_course_des($param)
{
$pdo = new DBUtils();
$sql = "update course set";
if (isset($param['courseDes'])) {
$sql .= " courseDes='{$param['courseDes']}',";
}
$sql = substr($sql, 0, strlen($sql) - 1);
$sql .= " where courseId = '{$param['courseId']}'";
return $pdo->update($sql);
}
示例3: edit
public static function edit($param)
{
$pdo = new DBUtils();
$sql = "update article set";
if (isset($param['articleImg'])) {
$sql .= " articleImg='{$param['articleImg']}', ";
}
if (isset($param['content'])) {
$sql .= " content='{$param['content']}',";
}
if (isset($param['title'])) {
$sql .= " title='{$param['title']}',";
}
if (isset($param['smallContent'])) {
$sql .= " smallContent='{$param['smallContent']}',";
}
if (isset($param['articleImg'])) {
$sql .= " articleImg='{$param['articleImg']}',";
}
$sql = substr($sql, 0, strlen($sql) - 1);
$sql .= " where articleId = '{$param['articleId']}'";
return $pdo->update($sql);
}
示例4: edit
public static function edit($aboutusId, $content)
{
$pdo = new DBUtils();
$sql = "update aboutus set content='{$content}' where aboutusId = '{$aboutusId}'";
$rs = $pdo->update($sql);
return $rs;
}