本文整理汇总了PHP中DataBase::ExecuteNonQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP DataBase::ExecuteNonQuery方法的具体用法?PHP DataBase::ExecuteNonQuery怎么用?PHP DataBase::ExecuteNonQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataBase
的用法示例。
在下文中一共展示了DataBase::ExecuteNonQuery方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: include
include "../../core.php5/GridSortPage.class.php";
include("../../core.php5/Utilities/Application.class.php");
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<?php
if ($_POST) {
USER::VerifySecurity();
$usr = $_SESSION['user'];
$q = "UPDATE albums SET descripcion='" . $_POST['descripcion'] . "', fecha= '" . substr($_POST['fecha'], 6, 4) . "-" . substr($_POST['fecha'], 0, 2) . "-" . substr($_POST['fecha'], 3, 2) . "' WHERE idalbum=" . $_POST['idalbum'] . " ";
$res = DataBase::ExecuteNonQuery($q);
if ($res) {
echo '<div id="temp" style="background-color:green;text-align:center;color:white"><b>Actualizado correctamente</b></div> ';
} else {
echo '<div style="background-color:red;text-align:center;color:white">Error al Guardar</div>';
}
} else {
$q = "SELECT * FROM albums WHERE idalbum=" . $_GET['id'];
ORM::Load($rs, $q);
?>
<body>
<form method="post" action="" name="miform">
<div id="">
<a href="javascript:;" onClick="get('select/noticias.php','content')" class="agregar">Regresar</a><br />
<table border="0" style="border:1px #000000 solid" ><tr><td align="center"><h3>Modificar Album</h3>
<table align="center" border="0" cellpadding="1" cellspacing="1" style="width: 100%;">
示例2: include
include("../../infopix.core.php5/DB/DataBase.class.php");
include("../../infopix.core.php5/GridSource.class.php");
include("../../infopix.core.php5/GridPresenter.class.php");
include("../../infopix.core.php5/GUI/HtmlLink.class.php");
include("../../infopix.core.php5/GUI/ComboBox.class.php");
include("../../infopix.core.php5/GridLinker.class.php");
include "../../infopix.core.php5/GridSorter.class.php";
include "../../infopix.core.php5/GridSortPage.class.php";
#include("../../infopix.core.php5/Security/User.class.php");
#include("../../infopix.core.php5/Security/SecurityManager.class.php");
include("../../infopix.core.php5/Utilities/Application.class.php");
if($nombre){
$sql = "INSERT INTO users VALUES (null, '$nombre', '$url', '$servidor')";
$res = DataBase::ExecuteNonQuery($sql);
if($res)
echo "<script> window.location = '../select/sites.php' </script>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form action="" method="post" name="miform" >
<table width="0%" align="center" border="0">
示例3: Update
public function Update($request){
unset($this->login);
unset($this->md5pass);
unset($this->security_profile_id);
if($request[password] == "") unset($this->pass);
else $request[password] = md5($request[password]);
ORM::DataBinding($this, $request);
$update_statement = ORM::UpdateStatement($this, "users");
$affected_rows = DataBase::ExecuteNonQuery($update_statement);
if($affected_rows == 1 || $affected_rows == 0)
return true;
else
return false;
}