當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DataBase::ExecuteNonQuery方法代碼示例

本文整理匯總了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%;">
開發者ID:risos007,項目名稱:thechurch,代碼行數:31,代碼來源:albums.php

示例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">
開發者ID:risos007,項目名稱:thechurch,代碼行數:31,代碼來源:usersinfo.php

示例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;
	}	
開發者ID:risos007,項目名稱:thechurch,代碼行數:18,代碼來源:User.class.php


注:本文中的DataBase::ExecuteNonQuery方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。