本文整理汇总了PHP中Common::executeQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP Common::executeQuery方法的具体用法?PHP Common::executeQuery怎么用?PHP Common::executeQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Common
的用法示例。
在下文中一共展示了Common::executeQuery方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getConfirmPassword
function getConfirmPassword()
{
$COMMON = new Common($debug);
$sql = "SELECT * FROM `Proj2Advisors` WHERE `New` = 'true'";
$rs = $COMMON->executeQuery($sql, "Advising Appointments");
$row = mysql_fetch_row($rs);
return $row[5];
}
示例2: getAdvisor
function getAdvisor()
{
$COMMON = new Common($debug);
$sID = $_SESSION["studID"];
$sql = "select * from Proj2Students where `StudentID` = '{$sID}'";
$rs = $COMMON->executeQuery($sql, $_SERVER["SCRIPT_NAME"]);
$row = mysql_fetch_row($rs);
return $row[7];
}
示例3: getStudent
function getStudent()
{
$debug = false;
$COMMON = new Common($debug);
//Use this as base for student access method
$sql = "select * from Proj2Students where `StudentID` = '{$this->ID}'";
$rs = $COMMON->executeQuery($sql, $_SERVER["SCRIPT_NAME"]);
$studRow = mysql_fetch_row($rs);
return $studRow;
//end
}
示例4: stage2
function stage2($_POST)
{
global $debug;
include '../../CommonMethods.php';
$COMMON = new Common($debug);
$sql = "insert into `work_orders` (`id`, `url`, `description`, `priority`, `author`, `time_entered`) values (null, '" . $_POST['url'] . "', '" . $_POST['description'] . "', '" . $_POST['priority'] . "', '" . $_SESSION['UserN'] . "', CURRENT_TIMESTAMP)";
$rs = $COMMON->executeQuery($sql, $_SERVER['SCRIPT_NAME']);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Work order</title>
<script type="text/javascript">
function saveValue(target){
var stepVal = document.getElementById(target).value;
alert("Value: " + stepVal);
}
</script>
<link rel='stylesheet' type='text/css' href='../css/standard.css'/>
</head>
<body>
<div id="login">
Thank you. Work order entered.
<form action="">
<input type="submit" name="home" class="button large" value="Close" onClick="window.close()">
</form>
</div>
</div>
</body>
</html>
<?php
$message = "From: " . $_SESSION['userN'] . "\n\r Priority: " . $_POST['priority'] . "\n\r " . $_POST['description'];
mail("slupoli@umbc.edu", "Work Order for COE Advising", $message);
}
示例5: strtoupper
<?php
session_start();
/*Set our session variables
$_SESSION["firstN"] = strtoupper($_POST["firstN"]);
$_SESSION["lastN"] = strtoupper($_POST["lastN"]);
$_SESSION["email"] = $_POST["email"];
$_SESSION["major"] = $_POST["major"];*/
//Set our local variables
$firstn = strtoupper($_POST["firstN"]);
$lastn = strtoupper($_POST["lastN"]);
$studid = $_SESSION["studID"];
$email = $_POST["email"];
$major = $_POST["major"];
$debug = false;
include '../CommonMethods.php';
$COMMON = new Common($debug);
//If the student exists, update their information
//if($_SESSION["studExist"] == true){
$sql = "update `Proj2Students` set `FirstName` = '{$firstn}', `LastName` = '{$lastn}', `Email` = '{$email}', `Major` = '{$major}' where `StudentID` = '{$studid}'";
$rs = $COMMON->executeQuery($sql, $_SERVER["SCRIPT_NAME"]);
//}
header('Location: 02StudHome.php');
示例6: Common
<link rel='stylesheet' type='text/css' href='./css/standard.css'/>
</head>
<body>
<div id="login">
<div id="form">
<div class="top">
<h1>Removed Appointment</h1><br>
<div class="field">
<?php
$debug = false;
include '../CommonMethods.php';
$COMMON = new Common($debug);
$ind = $_POST["IndApp"];
parse_str($ind);
$sql = "SELECT `id` FROM `Proj2Advisors` WHERE `FirstName` = '{$row['1']}' AND `LastName` = '{$row['2']}'";
$rs = $COMMON->executeQuery($sql, "Advising Appointments");
$rod = mysql_fetch_row($rs);
$adv = $rod[0];
if ($row[4]) {
$sql = "SELECT `FirstName`, `LastName`, `Email` FROM `Proj2Students` WHERE `StudentID` = '{$row['4']}'";
$rs = $COMMON->executeQuery($sql, "Advising Appointments");
$ros = mysql_fetch_row($rs);
$std = $ros[0] . " " . $ros[1];
$eml = $ros[2];
}
$sql = "DELETE FROM `Proj2Appointments` WHERE `Time` = '{$row['0']}' AND `AdvisorID` = '{$adv}' AND `Major` = '{$row['3']}' AND `EnrolledID` = '{$row['4']}'";
$rs = $COMMON->executeQuery($sql, "Advising Appointments");
echo "Time: " . date('l, F d, Y g:i A', strtotime($row[0])) . "<br>";
echo "Advisor: {$row['1']} {$row['2']}<br>";
echo "Majors included: ";
if ($row[3]) {
示例7: Common
<?php
session_start();
//Only student ID is created as a session variable
include '../../CommonMethods.php';
$debug = false;
$Common = new Common($debug);
$_SESSION["studID"] = strtoupper($_POST["studID"]);
$studID1 = $_SESSION["studID"];
$sql = "SELECT * FROM `Proj2Students` WHERE `StudentID` = '{$studID1}'";
$rs = $Common->executeQuery($sql, "Advising Appointments");
$row = mysql_fetch_row($rs);
if ($row) {
header('Location: 02StudHome.php');
} else {
$first = $_POST["firstN"];
$last = $_POST["lastN"];
$studID = $_SESSION["studID"];
$email = $_POST["email"];
$major = $_POST["major"];
//Else insert into the database!
$sql = "INSERT INTO `Proj2Students`(`FirstName`, `LastName`, `StudentID`, `Email`, `Major`)\n \t\t\tVALUES ('{$first}', '{$last}', '{$studID}', '{$email}','{$major}')";
//echo ("<h3>$first $last<h3>");
$rs = $Common->executeQuery($sql, "Advising Appointments");
header('Location: 02StudHome.php');
}
示例8: Common
</script>
<link rel='stylesheet' type='text/css' href='../css/standard.css'/>
</head>
<body>
<div id="login">
<div id="form">
<div class="top">
<h2>Select which appointment you would like to change: </h2>
<div class="field">
<?php
$debug = false;
include '../CommonMethods.php';
$COMMON = new Common($debug);
$sql = "SELECT * FROM `Proj2Appointments` WHERE `AdvisorID` != '0' and `Time` > '" . date('Y-m-d H:i:s') . "' ORDER BY `Time`";
$rs = $COMMON->executeQuery($sql, "Advising Appointments");
$row = mysql_fetch_array($rs, MYSQL_NUM);
//first item in row
if ($row) {
echo "<form action=\"AdminConfirmEditInd.php\" method=\"post\" name=\"Confirm\">";
echo "<table border='1px'>\n<tr>";
echo "<tr><td width='320px'>Time</td><td>Majors</td><td>Enrolled</td></tr>\n";
//get the advisor name
$secsql = "SELECT `FirstName`, `LastName` FROM `Proj2Advisors` WHERE `id` = '{$row['2']}'";
$secrs = $COMMON->executeQuery($secsql, "Advising Appointments");
$secrow = mysql_fetch_row($secrs);
if ($row[4]) {
$trdsql = "SELECT `FirstName`, `LastName` FROM `Proj2Students` WHERE `StudentID` = '{$row['4']}'";
$trdrs = $COMMON->executeQuery($trdsql, "Advising Appointments");
$trdrow = mysql_fetch_row($trdrs);
}
示例9: foreach
}
}
//major stuff
$majorDB = "";
$majorPrint = "All";
if (!empty($majors)) {
$majorPrint = "";
foreach ($majors as $m) {
$majorDB .= $m . " ";
$majorPrint .= $m . ", ";
}
$majorPrint = substr($majorPrint, 0, -2);
}
//get advisor id
$sql = "select * from `Proj2Advisors` where `id` = '{$_SESSION["UserId"]}'";
$rs = $COMMON->executeQuery($sql, $_SERVER["SCRIPT_NAME"]);
$row = mysql_fetch_row($rs);
$id = $row[0];
/* Loop through $datetimes and create the "SELECT" query */
$selectQuery = "SELECT * from `Proj2Appointments` WHERE ";
$sentinel = 0;
foreach ($datetimes as $dt) {
// If this is the first time, don't print 'OR...'
if ($sentinel != 0) {
$selectQuery .= "OR ";
}
// Start with the parenthesises
$selectQuery .= "(";
//Check for Time
$selectQuery .= "`Time` = '";
$selectQuery .= $dt;
示例10: getAdvisorPassword
function getAdvisorPassword($username)
{
global $debug;
$Common = new Common($debug);
$sql2 = "select * from Proj2Advisors where `Username` = '{$username}'";
$rs2 = $Common->executeQuery($sql2, $_SERVER["SCRIPT_NAME"]);
$row2 = mysql_fetch_row($rs2);
$advisorName = $row2[4];
return $advisorName;
}
示例11:
</head>
<body>
<div id="login">
<div id="form">
<div class="top">
<h2> Hello
<?php
// someone landed this page by accident
if (!isset($_SESSION["UserN"])) {
return;
}
// grab the user from the database query
$User = $_SESSION["UserN"];
$Pass = $_SESSION["PassW"];
$sql = "SELECT `firstName` FROM `Proj2Advisors` \n\t\t\tWHERE `Username` = '{$User}' \n\t\t\tand `Password` = '{$Pass}'";
$rs = $COMMON->executeQuery($sql, $_SERVER["AdminUI"]);
$row = mysql_fetch_row($rs);
echo $row[0];
?>
</h2>
<!-- add the various option buttons to the user -->
<form action="AdminProcessUI.php" method="post" name="UI">
<input type="submit" name="next" class="button large selection" value="Schedule appointments"><br>
<input type="submit" name="next" class="button large selection" value="Print schedule for a day"><br>
<input type="submit" name="next" class="button large selection" value="Edit appointments"><br>
<input type="submit" name="next" class="button large selection" value="Search for an appointment"><br>
<input type="submit" name="next" class="button large selection" value="Create new Admin Account"><br>
</form>
<br>
示例12: Common
/usr/bin/fs sa /afs/umbc.edu/public/web/sites/coeadvising/prod/php/session/ web.coeadvising all
then edit .htaccess file here in the same directory
*/
session_start();
include 'GetAdvisorData.php';
$debug = false;
$Common = new Common($debug);
// Added to get admin ID from the input username
$tempN = $_POST["UserN"];
$tempP = $_POST["PassW"];
$sql = "SELECT * FROM `Proj2Advisors` WHERE `Username` = '{$tempN}' AND `Password` = '{$tempP}'";
$rs = $Common->executeQuery($sql, $_SERVER["SCRIPT_NAME"]);
$row = mysql_fetch_row($rs);
$_SESSION["userID"] = $row[0];
// Addition to provide a single session variable in place of all others
$user = getUsername();
$pass = getPassword();
$sql = "SELECT * FROM `Proj2Advisors` WHERE `Username` = '{$user}' AND `Password` = '{$pass}'";
$rs = $Common->executeQuery($sql, "Advising Appointments");
$row = mysql_fetch_row($rs);
if ($row) {
if ($debug) {
echo "<br>" . var_dump($_SESSION) . "<- Session variables above<br>";
} else {
header('Location: AdminUI.php');
}
} else {