本文整理汇总了PHP中ExecuteNonQuery函数的典型用法代码示例。如果您正苦于以下问题:PHP ExecuteNonQuery函数的具体用法?PHP ExecuteNonQuery怎么用?PHP ExecuteNonQuery使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ExecuteNonQuery函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_addSpecialCourse
function test_addSpecialCourse()
{
$_POST['spCourse'] = 1;
$_POST['cbxactive'] = 1;
$_POST['txtcredits'] = 3;
if (isset($_POST['spCourse'])) {
$spActive = $_POST['spCourse'];
}
$i = 0;
if (isset($_POST["cbxactive"])) {
$i = 1;
}
//@@ -59,8 +60,8 @@
$credits = $_POST['txtcredits'];
//$credits=$_POST["txtcredits"];
// $cdet=str_replace("'","\'",$cdet);
$cid = 1;
$cnm = "Test Name";
$cdet = "Test description";
$prereq = 20;
$coreq = 21;
$credits = 3;
$sql = "insert into courses(courseno,coursename,special,description,prereqid,coreqid,credits,active,deptid)values(";
$sql .= "'" . strtoupper($cid) . "','" . $cnm . "',{$spActive},'{$cdet}',{$prereq},{$coreq},{$credits},{$i},1)";
echo $sql;
$result = ExecuteNonQuery($sql);
$this->assertTrue($result);
}
示例2: ExecuteNonQuery
</div>
<div id="content">
<div id="viewcatdiv">
<div id="info">
<p>This page displays Departments.<span style="float:right;"><a href="adddepartment.php"><img src="images/Add.png" alt="Add" width="50px"></a></span></p>
</div>
<div id="viewbannercontent">
<table>
<tr>
<th align="left">Prefix</th>
<th>Deptartment Name</th>
<th>Active??</th>
<th>Edit</th>
</tr>
<?php
$data = ExecuteNonQuery('select * FROM dept');
while ($info = mysqli_fetch_assoc($data)) {
?>
<tr>
<td ><?php
echo $info["prefix"];
?>
</td>
<td><?php
echo $info["deptname"];
?>
</td>
<td><input type="checkbox" <?php
if ($info["active"] == 1) {
echo " checked";
示例3: session_start
<?php
session_start();
require "header.php";
require "checkUser.php";
?>
<?php
$upd = "update question set views=views+1 where question_id={$_GET['qid']}";
$res = ExecuteNonQuery($upd);
$str = "SELECT * from question, user where user.user_id=question.user_id AND question_id={$_GET['qid']}";
$result = ExecuteQuery($str);
$no_rows = mysql_num_rows($result);
$head = "";
if ($no_rows > 0) {
while ($row = mysql_fetch_array($result)) {
$head = $row['heading'];
echo "<h4>";
echo $head;
echo "</h4>";
echo "<span class='box2'>";
echo "<span class='head'><a href='answer.php?id={$_GET['qid']}'>REPLY</a></span>";
echo "<table>";
echo "<tr><td valign='top' width='100px'>\n\t\t\t\t<img src='{$row['uimg']}' alt='' class='uimg'/>\n\t\t\t\t<br/>\n\t\t\t{$row['fullname']}\n\t\t\t<td valign='top'>\n\t\t\t<b>{$head}</b><br/>\n\t\t\t{$row['datetime']}<br/><br/>\n\t\t\t{$row['question_detail']}</tr>";
echo "</table></span><div class='h10'></div>";
}
}
?>
<?php
示例4: ExecuteNonQuery
<img src="images/cross.png" width="25px" height="25px"><?php
echo $_GET["msg"];
?>
</div>
<?php
}
?>
<form method="post" action="kimgcategories.php">
<table style="margin-top:20px;">
<tr>
<td>Select Category</td>
<td>:</td>
<td>
<select name="ddcatid">
<?php
$data = ExecuteNonQuery('select * FROM kitchencategories where active=1') or die(mysql_error());
while ($info = mysql_fetch_assoc($data)) {
?>
<option value="<?php
echo $info["imgcatid"];
?>
"><?php
echo $info["imgcatname"];
?>
</option>
<?php
}
?>
</select>
</td>
</tr>
示例5: session_start
<?php
session_start();
require "header.php";
require "checkUser.php";
$uto = $_POST['uto'];
$tt = $_POST['tt'];
$sql = "INSERT INTO chatmaster (user_id_from,user_id_to) values ({$_SESSION['uid']},{$uto})";
$result = ExecuteNonQuery($sql);
$sql = "SELECT MAX(chat_id) as cid FROM chatmaster";
$row = mysql_fetch_array(ExecuteQuery($sql));
$cid = $row['cid'];
$sql = "INSERT INTO chat (user_id, chat_id, message) values ({$_SESSION['uid']},{$cid},'{$tt}')";
$result += ExecuteNonQuery($sql);
if ($result == 2) {
header("location:messaged.php");
}
require "footer.php";
示例6: ExecuteNonQuery
<?php
if ($_GET["flag"] == 2) {
?>
<div id="diverror">
<img src="images/cross.png" width="25px" height="25px"><?php
echo $_GET["msg"];
?>
</div>
<?php
}
?>
<div id="info">
<p>This page will change the admin email.</p>
</div>
<?php
$data = ExecuteNonQuery('select * FROM users where id=' . $_SESSION["a_userid"]) or die(mysql_error());
while ($info = mysql_fetch_assoc($data)) {
$email = $info["email"];
}
?>
<form method="post" action="changeemail.php">
<table>
<tr>
<td colspan="3" >
<?php
if (!empty($message)) {
echo "<p class=message>" . $message . "</p>";
} else {
echo " ";
}
?>
示例7: ExecuteNonQuery
<textarea name="tagp" id="tagp" rows="10" cols="50">
<?php
if (isset($gp) && $gp != "") {
echo $gp;
} else {
?>
<table>
<tr>
<td style="vertical-align:top;">
<table border="1">
<tr>
<th>Grade Componenent</th>
<th>Weight</th>
</tr>
<?php
$data = ExecuteNonQuery("select camid,camname from cams where csid=" . $_SESSION["mapcsid"] . " and uid=" . $_SESSION["userid"] . " and semid=" . $_SESSION["ddlsem3"]);
// $cnt=1;
while ($info = mysqli_fetch_assoc($data)) {
?>
<tr>
<th><?php
echo $info["camname"];
?>
</th>
<th>[NN%]</th>
</tr>
<?php
}
?>
</table>
</td>
示例8: CountRecords
if ($_GET["flag"] == "0") {
$cnt = CountRecords("select * from fileinfo where ftype='matrix'");
if ($cnt != 0) {
ExecuteNonQuery("update fileinfo set active=0 where ftype='matrix'");
}
$sql = "update fileinfo set active=1 where version='" . $_SESSION["ver"] . "' and ftype='matrix'";
ExecuteNonQuery($sql);
redirect_to("welcome.php");
} else {
if ($_GET["flag"] == "1") {
$cnt = CountRecords("select * from fileinfo where ftype='gmatrix'");
if ($cnt != 0) {
ExecuteNonQuery("update fileinfo set active=0 where ftype='gmatrix'");
}
$sql = "update fileinfo set active=1 where version='" . $_SESSION["ver"] . "' and ftype='gmatrix'";
ExecuteNonQuery($sql);
redirect_to("welcome.php");
}
}
}
}
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Thank You</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
示例9: ExecuteNonQuery
CKEDITOR.config.toolbar_MA = [['Source', '-', 'Cut', 'Copy', 'Paste', '-', 'Undo', 'Redo', 'RemoveFormat', '-', 'Link', 'Unlink', 'Anchor', '-', 'Image', 'Table', 'HorizontalRule', 'SpecialChar'], '/', ['Format', 'Templates', 'Bold', 'Italic', 'Underline', '-', 'Superscript', '-', ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], '-', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent']];
CKEDITOR.replace('tabooks',
{toolbar: 'MA'}
);
</script>
</td>
</tr>
<tr>
<td>Course Assessment Method</td>
<td>:</td>
<td>
<?php
$cnt = 0;
if (isset($_POST["ddlcnm"])) {
$sql = "select camid,camname,camdetails from cams where csid=" . $_POST["ddlcnm"] . " and uid=" . $_SESSION["userid"] . " and semid=" . $_SESSION["ddlsem3"];
$data3 = ExecuteNonQuery($sql);
//echo $sql;
$cntrec1 = mysqli_num_rows($data3);
$cnt = mysqli_num_rows($data3);
// echo $cnt;
}
?>
<div style="width:100%">
<table align="left" id="camtable" style="float:left;width:60%">
<tr>
<th align="left">Name</th>
<th align="left">Description</th>
</tr>
<?php
if ($cnt > 0) {
$cnt = 1;
示例10: ExecuteNonQuery
<?php
include "leftpane.php";
?>
</div>
<div id="content">
<div id="addcatdiv">
<div id="info">
<p>This page edit user details<span style="float:right;"><a href="viewusers.php"><img src="images/view.png" alt="view" width="50px"></a></p>
</div>
<div id="contentdetail">
<form method="post" action="edituser.php?id=<?php
echo $_GET["id"];
?>
">
<?php
$data = ExecuteNonQuery('select * FROM users where uid=' . $_GET["id"]);
while ($info = mysqli_fetch_assoc($data)) {
$username = $info["username"];
$firstname = $info["firstname"];
$lastname = $info["lastname"];
$sal = $info["salutation"];
$email = $info["email"];
$officeno = $info["officeno"];
$office = $info["office"];
$isadmin = $info["permission"];
$isactive = $info["active"];
}
?>
<table style="width:60%;">
<tr>
示例11: redirect_to
require_once "includes/session.php";
include_once "includes/form_functions.php";
require_once "includes/functions.php";
include_once "includes/DataAccess.php";
if (!logged_in()) {
redirect_to("index.php");
}
if (isset($_POST["Submit"])) {
backup_tables();
$old_date = date('l, F d y h:i:s');
// returns Saturday, January 30 10 02:06:34
$old_date_timestamp = strtotime($old_date);
$new_date = date('m-d-Y', $old_date_timestamp);
$str = 'db-backup_' . $new_date;
$qry = "insert into dbbackup(backupname)values('" . $str . ".sql')";
$cnt = ExecuteNonQuery($qry);
if ($cnt > 0) {
redirect_to("viewbackups.php");
}
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Add Back Up</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
示例12: ExecuteNonQuery
<p>This page displays banner uploaded into website.<span style="float:right;"><a href="addimage.php"><img src="images/Add.png" alt="Add" width="50px"></a></span></p>
</div>
<div id="viewbannercontent">
<table>
<!-- <tr>
<td colspan="3"><img src="images/viewbanner.png" height="100px" width="100%"></td>
</tr>
--><tr>
<th>Image Name</th>
<th>Image</th>
<th>Display Order</th>
<th>Visible</th>
<th> </th>
</tr>
<?php
$data = ExecuteNonQuery('select * FROM images order by disporder') or die(mysql_error());
while ($info = mysql_fetch_assoc($data)) {
$tit = getfilename($info["imagetitle"]);
$ext = getExtension($info["imagetitle"]);
?>
<tr>
<td><a href="viewimagedetails.php?id=<?php
echo $info["imageid"];
?>
"><?php
echo $info["imagename"];
?>
</a></td>
<td>
<a href="../usrfiles/large/<?php
示例13: ExecuteNonQuery
<div id="profilecontent">
<form method="post" action="editoffhrs.php?id=<?php
echo $_GET["id"];
?>
">
<?php
$data2 = ExecuteNonQuery('select semname,year FROM semester where active=1');
$snm = "";
$syr = "";
while ($info2 = mysqli_fetch_assoc($data2)) {
$snm = $info2["semname"];
$syr = $info2["year"];
}
?>
<?php
$data3 = ExecuteNonQuery('select * from facultyhours where fhid=' . $_GET["id"]);
$sttime = "";
$entime = "";
$cday = array();
while ($info3 = mysqli_fetch_assoc($data3)) {
$sttime = explode(":", $info3["starttime"]);
$entime = explode(":", $info3["endtime"]);
$cday = explode(" ", $info3["cday"]);
}
?>
<table>
<tr>
<td colspan="3"><?php
echo "<i>Current Semester:</i>" . $snm . " " . $syr;
?>
</td>
示例14: ExecuteNonQuery
?>
</div>
<div id="content">
<div id="viewcatdiv">
<div id="info">
<p>This page displays buildings.<span style="float:right;"><a href="addbuilding.php"><img src="images/Add.png" alt="Add" width="50px"></a></span></p>
</div>
<div id="viewbannercontent">
<table>
<tr>
<th>Building Name</th>
<th>Active??</th>
<th>Edit</th>
</tr>
<?php
$data = ExecuteNonQuery('select * FROM buildings');
while ($info = mysqli_fetch_assoc($data)) {
?>
<tr>
<td><?php
echo $info["bname"];
?>
</td>
<td><input type="checkbox" <?php
if ($info["active"] == 1) {
echo " checked";
}
?>
disabled></td>
<td><a href="editbuilding.php?id=<?php
示例15: ExecuteNonQuery
<?php
include "leftpane.php";
?>
</div>
<div id="content">
<div id="addcatdiv">
<div id="info">
<p>This page edit building details of image<span style="float:right;"><a href="viewcategories.php"><img src="images/view.png" alt="view" width="50px"></a></p>
</div>
<div id="contentdetail">
<form method="post" action="editbuilding.php?id=<?php
echo $_GET["id"];
?>
">
<?php
$data = ExecuteNonQuery('select * FROM buildings where bid=' . $_GET["id"]);
while ($info = mysqli_fetch_assoc($data)) {
$bname = $info["bname"];
$active = $info["active"];
}
?>
<table>
<tr>
<td colspan="3" >
<?php
if (!empty($message)) {
echo "<p class=message>" . $message . "</p>";
} else {
echo " ";
}