当前位置: 首页>>代码示例>>PHP>>正文


PHP Style::update方法代码示例

本文整理汇总了PHP中Style::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Style::update方法的具体用法?PHP Style::update怎么用?PHP Style::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Style的用法示例。


在下文中一共展示了Style::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Style

		<?php 
include '../menu_top.php';
?>
		<h2>Update brewery</h2>
		<?php 
require_once '../../models/style.php';
if (isset($_POST['newName']) && isset($_POST['description']) && isset($_POST['id'])) {
    $id = $_POST['id'];
    $newName = $_POST['newName'];
    $description = $_POST['description'];
    if (empty($newName) || empty($description) || empty($id)) {
        echo "<br><div class='alert alert-info col-md-8'>All fields are required!</div>";
    } else {
        $style = new Style();
        echo "asdasd";
        if ($up = $style->update($id, $newName, $description)) {
            header('Location: index.php');
            die;
        }
    }
}
?>
		<form id='new-style-form' action='', method='POST'>
			<div class="col-md-8">
				<table class="table table-striped">
					<tr>
						<th>Name:</th>
						<td>
							<input type='text' name='newName' value="<?php 
if (isset($_POST['name'])) {
    echo $_POST['name'];
开发者ID:k4hun,项目名称:beers-blog-php,代码行数:31,代码来源:update.php

示例2: MAX

        $UpdateStyleQueryId = mysql_query($UpdateStyleQuery);
        $GetStyleIdQuery = "SELECT MAX(i_StyleSheetId) i_StyleSheetId FROM StyleSheet where i_UID = {$hdnUserId}";
        $GetStyleIdQueryId = mysql_query($GetStyleIdQuery);
        $GetStyleIdResults = mysql_fetch_object($GetStyleIdQueryId);
        $selUserStyle = $GetStyleIdResults->i_StyleSheetId;
        $UpdateStyleQueryId = $style->create($selUserStyle, $txtStyleSheet);
    } else {
        $selUserStyle = $hdnStyleId;
        $UpdateStyleQuery = "UPDATE StyleSheet ";
        $UpdateStyleQuery .= " set i_UID = {$hdnUserId},";
        $UpdateStyleQuery .= " i_StyleSheetTypeId = 1,";
        $UpdateStyleQuery .= " i_Public = {$iStylePublic},";
        $UpdateStyleQuery .= " vc_Name = \"{$txtStyleName}\"";
        $UpdateStyleQuery .= " WHERE i_StyleSheetId = {$hdnStyleId}";
        $UpdateStyleQueryId = mysql_query($UpdateStyleQuery);
        $UpdateStyleQueryId = $style->update($hdnStyleId, $txtStyleSheet);
        if (!empty($btnMakeStyle)) {
            $UpdateUserStyleQuery = "DELETE FROM UserStyleSheet WHERE i_UID = {$hdnUserId}";
            $UpdateUserStyleQueryId = mysql_query($UpdateUserStyleQuery);
            $UpdateUserStyleQuery = "INSERT INTO UserStyleSheet (i_UID, i_StyleSheetId)";
            $UpdateUserStyleQuery .= " VALUES ({$hdnUserId}, {$hdnStyleId})";
            $UpdateUserStyleQueryId = mysql_query($UpdateUserStyleQuery);
        }
    }
} else {
    if (!empty($btnMakePublicStyle)) {
        $UpdateUserStyleQuery = "DELETE FROM UserStyleSheet WHERE i_UID = {$hdnUserId}";
        $UpdateUserStyleQueryId = mysql_query($UpdateUserStyleQuery);
        $UpdateUserStyleQuery = "INSERT INTO UserStyleSheet (i_UID, i_StyleSheetId)";
        $UpdateUserStyleQuery .= " VALUES ({$hdnUserId}, {$hdnPublicStyleId})";
        $UpdateUserStyleQueryId = mysql_query($UpdateUserStyleQuery);
开发者ID:robdrimmie,项目名称:babynewt,代码行数:31,代码来源:editstyles.php


注:本文中的Style::update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。