本文整理汇总了PHP中connectSql函数的典型用法代码示例。如果您正苦于以下问题:PHP connectSql函数的具体用法?PHP connectSql怎么用?PHP connectSql使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了connectSql函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: houseInfo
function houseInfo($name, $phone, $cardNumber)
{
connectSql('', '', '', '');
$sql = "select * from tb_membernew,tb_csthouseinfo where tb_numbernew.id = tb_csthouseinfo.fk_member ={$id}";
if (checkVip($name, $phone, $cardNumber) == true) {
$query = mssql_query($sql);
return $query;
}
}
示例2: setDefaultConfig
function setDefaultConfig()
{
global $con;
if (!$con) {
if (!connectSql()) {
return false;
}
}
$sql = "select * from wx_config where 1";
if (mysql_num_rows(mysql_query($sql)) < 1) {
$sql = "INSERT INTO `wx_config`(`appid`, `appsecrect`, `default_template`, `first_msg`, `url`, `ex_msg`, `access_token`, `createtime`) VALUES ('" . APPID . "','" . APPSECRECT . "','" . DEFAULT_TPL . "','" . FIRST_MSG . "','" . URL . "','" . EX_MSG . "','" . ACCESS_TOKEN . "',10000)";
if (!mysql_query($sql)) {
return false;
}
}
return true;
}
示例3: request
$tmpquery = "WHERE org.id = '{$organization}'";
$detailOrganization = new request();
$detailOrganization->openOrganizations($tmpquery);
$comptDetailOrganization = count($detailOrganization->org_id);
if ($action == "delete") {
$id = str_replace("**", ",", $id);
$tmpquery1 = "DELETE FROM " . $tableCollab["members"] . " WHERE id IN({$id})";
$tmpquery2 = "UPDATE " . $tableCollab["tasks"] . " SET assigned_to='{$at}' WHERE assigned_to IN({$id})";
$tmpquery3 = "UPDATE " . $tableCollab["assignments"] . " SET assigned_to='{$at}',assigned='{$dateheure}' WHERE assigned_to IN({$id})";
$tmpquery4 = "DELETE FROM " . $tableCollab["notifications"] . " WHERE member IN({$id})";
$tmpquery5 = "DELETE FROM " . $tableCollab["teams"] . " WHERE member IN({$id})";
connectSql("{$tmpquery1}");
connectSql("{$tmpquery2}");
connectSql("{$tmpquery3}");
connectSql("{$tmpquery4}");
connectSql("{$tmpquery5}");
//if mantis bug tracker enabled
if ($enableMantis == "true") {
// Call mantis function to remove user
include "../mantis/user_delete.php";
}
headerFunction("../clients/viewclient.php?id={$organization}&msg=delete&" . session_name() . "=" . session_id());
exit;
}
include '../themes/' . THEME . '/header.php';
$blockPage = new block();
$blockPage->openBreadcrumbs();
$blockPage->itemBreadcrumbs($blockPage->buildLink("../clients/listclients.php?", $strings["clients"], in));
$blockPage->itemBreadcrumbs($blockPage->buildLink("../clients/viewclient.php?id=" . $detailOrganization->org_id[0], $detailOrganization->org_name[0], in));
$blockPage->itemBreadcrumbs($strings["delete_users"]);
$blockPage->closeBreadcrumbs();
示例4: connectSql
connectSql($tmpquery6);
}
if ($topics != '') {
$tmpquery7 = 'DELETE FROM ' . $tableCollab['posts'] . ' WHERE topic IN(' . $topics . ')';
connectSql($tmpquery7);
}
$tmpquery8 = 'DELETE FROM ' . $tableCollab['notes'] . ' WHERE project IN(' . $id . ')';
connectSql($tmpquery8);
$tmpquery9 = 'DELETE FROM ' . $tableCollab['support_requests'] . ' WHERE project IN(' . $id . ')';
connectSql($tmpquery9);
$tmpquery10 = 'DELETE FROM ' . $tableCollab['support_posts'] . ' WHERE project IN(' . $id . ')';
connectSql($tmpquery10);
$tmpquery11 = 'DELETE FROM ' . $tableCollab['phases'] . ' WHERE project_id IN(' . $id . ')';
connectSql($tmpquery11);
$tmpquery12 = 'DELETE FROM ' . $tableCollab['tasks_time'] . ' WHERE project IN(' . $id . ')';
connectSql($tmpquery12);
// if mantis bug tracker enabled
if ($enableMantis == 'true') {
// call mantis function to delete project
require_once '../mantis/proj_delete.php';
}
header('Location: ../projects/listprojects.php?msg=delete');
exit;
}
//--- header ----
$breadcrumbs[] = buildLink('../projects/listprojects.php?', $strings['projects'], LINK_INSIDE);
$breadcrumbs[] = $strings['delete_projects'];
$pageSection = 'projects';
require_once '../themes/' . THEME . '/header.php';
//--- content ---
$block1 = new block();
示例5: file_get_contents
<?php
include "core.php";
$input = file_get_contents("php://input");
$data = json_decode($input, true);
if ($_SERVER["REQUEST_METHOD"] == "GET") {
//if (strlen($_GET["course_id"]) <= 4) {
$id = mysqli_real_escape_string(connectSql(), $_GET["id"]);
echo json_encode(db_select("TutorCoursesRelation", "email", $id));
//}
} else {
if ($_SERVER["REQUEST_METHOD"] == "POST") {
db_insert("Request", $data);
} else {
if ($_SERVER["REQUEST_METHOD"] == "PUT") {
db_update("Request", $data, "to_email");
}
}
}
示例6: taskComputeCompletion
function taskComputeCompletion($taskid, $tableTask)
{
$tmpquery = "WHERE subtas.tasks = '{$taskid}'";
$subtaskList = new request();
$subtaskList->openAvgTasks($taskid);
$avg = $subtaskList->tas_avg[0];
settype($avg, "integer");
$tmpquery6 = "UPDATE " . $tableTask . " set completion = {$avg} where id='{$taskid}'";
connectSql($tmpquery6);
}
示例7: addSlashes
// make sure we have the required information
if (!empty($hr)) {
if (!is_numeric($hr)) {
// we need this to be numeric
$msgLabel = '<b>' . $strings['attention'] . '</b> : ' . $strings['worked_hours'] . ' ' . $strings['error_numerical'];
}
} else {
// we need this to be numeric
$msgLabel = '<b>' . $strings['attention'] . '</b> : ' . $strings['worked_hours'] . ' ' . $strings['error_required'];
}
// insert task time in database
if (empty($msgLabel)) {
$comm = addSlashes($comm);
// resolves bug #768688
$tmpquery1 = 'INSERT INTO ' . $tableCollab['tasks_time'] . " (project,task,owner,date,hours,comments,created,modified) VALUES ('" . $projectDetail->pro_id[0] . "', '{$id}','{$owner}','{$ld}','{$hr}','{$comm}',NOW(),NOW())";
connectSql($tmpquery1);
$ld = null;
$hr = null;
$comm = null;
// successful insert
$msgLabel = '<b>' . $strings['success'] . '</b> : ' . $strings['hours_updated'];
}
$msg = $msgLabel;
}
//--- header ---
$breadcrumbs[] = buildLink("../projects/listprojects.php?", $strings["projects"], LINK_INSIDE);
$breadcrumbs[] = buildLink("../projects/viewproject.php?id=" . $projectDetail->pro_id[0], $projectDetail->pro_name[0], LINK_INSIDE);
$breadcrumbs[] = buildLink("../tasks/listtasks.php?project=" . $projectDetail->pro_id[0], $strings["tasks"], LINK_INSIDE);
$breadcrumbs[] = buildLink("../tasks/viewtask.php?id=" . $taskDetail->tas_id[0], $taskDetail->tas_name[0], LINK_INSIDE);
$breadcrumbs[] = $strings["add_task_time"];
require_once "../themes/" . THEME . "/header.php";
示例8: convertData
if ($pw != $pwa || $pw == "") {
$error = $strings["new_password_error"];
} else {
// replace quotes by html code in name and address
$fn = convertData($fn);
$tit = convertData($tit);
$c = convertData($c);
$pw = get_password($pw);
$tmpquery1 = "INSERT INTO " . $tableCollab["members"] . "(organization,login,name,title,email_work,phone_work,phone_home,mobile,fax,comments,password,profil,created,timezone) VALUES('{$clod}','{$un}','{$fn}','{$tit}','{$em}','{$wp}','{$hp}','{$mp}','{$fax}','{$c}','{$pw}','3','{$dateheure}','0')";
connectSql("{$tmpquery1}");
$tmpquery = $tableCollab["members"];
last_id($tmpquery);
$num = $lastId[0];
unset($lastId);
$tmpquery3 = "INSERT INTO " . $tableCollab["notifications"] . "(member,taskAssignment,removeProjectTeam,addProjectTeam,newTopic,newPost,statusTaskChange,priorityTaskChange,duedateTaskChange,clientAddTask) VALUES ('{$num}','0','0','0','0','0','0','0','0','0')";
connectSql("{$tmpquery3}");
// if mantis bug tracker enabled
if ($enableMantis == "true") {
// Call mantis function for new user creation!!!
$f_access_level = $client_user_level;
// Reporter
require_once "../mantis/create_new_user.php";
}
header("Location: ../clients/viewclient.php?id={$clod}&msg=add");
exit;
}
}
}
}
//--- header ---
$breadcrumbs[] = buildLink("../clients/listclients.php?", $strings["clients"], LINK_INSIDE);
示例9: request
$tmpquery = "WHERE tea.member = '{$pieces[$j]}'";
$listTeams = new request();
$listTeams->openTeams($tmpquery);
$comptListTeams = count($listTeams->tea_id);
for ($i = 0; $i < $comptListTeams; $i++) {
cvs_delete_user($listTeams->tea_mem_login[$i], $listTeams->tea_pro_id[$i]);
}
}
}
connectSql("{$tmpquery1}");
connectSql("{$tmpquery2}");
connectSql("{$tmpquery3}");
connectSql("{$tmpquery4}");
connectSql("{$tmpquery5}");
connectSql("{$tmpquery6}");
connectSql("{$tmpquery7}");
// if mantis bug tracker enabled
if ($enableMantis == "true") {
// Call mantis function to remove user
require_once "../mantis/user_delete.php";
}
header("Location: ../users/listusers.php?msg=delete");
exit;
}
//--- header -----
$breadcrumbs[] = buildLink("../administration/admin.php?", $strings["administration"], LINK_INSIDE);
$breadcrumbs[] = buildLink("../users/listusers.php?", $strings["user_management"], LINK_INSIDE);
$breadcrumbs[] = $strings["delete_users"];
require_once "../themes/" . THEME . "/header.php";
//--- content -----
$block1 = new block();
示例10: IN
$tmpquery2 = "DELETE FROM " . $tableCollab["attendants"] . " WHERE meeting IN({$id})";
$tmpquery3 = "DELETE FROM " . $tableCollab["meetings_attachment"] . " WHERE meeting IN({$id})";
$tmpquery4 = "DELETE FROM " . $tableCollab["meetings_time"] . " WHERE meeting IN({$id})";
$tmpquery = "WHERE mee.id IN({$id})";
$listMeetings = new request();
$listMeetings->openMeetings($tmpquery);
$comptListMeetings = count($listMeetings->mee_id);
for ($i = 0; $i < $comptListMeetings; $i++) {
if ($fileManagement == "true") {
delDir("../files/" . $listMeetings->mee_project[$i] . "/meetings/" . $listMeetings->mee_id[$i]);
}
}
connectSql("{$tmpquery1}");
connectSql("{$tmpquery2}");
connectSql("{$tmpquery3}");
connectSql("{$tmpquery4}");
if ($project != "") {
header("Location: ../projects/viewproject.php?id={$project}&msg=delete");
exit;
} else {
header("Location: ../general/home.php?msg=delete");
exit;
}
}
$tmpquery = "WHERE pro.id = '{$project}'";
$projectDetail = new request();
$projectDetail->openProjects($tmpquery);
// ---- header -----------------
if ($project != "") {
$breadcrumbs[] = buildLink("../projects/listprojects.php?", $strings["projects"], LINK_INSIDE);
$breadcrumbs[] = buildLink("../projects/viewproject.php?id=" . $projectDetail->pro_id[0], $projectDetail->pro_name[0], LINK_INSIDE);
示例11: IN
$listSubtasks->openSubtasks($tmpquery);
$tmpquery1 = "DELETE FROM " . $tableCollab["subtasks"] . " WHERE id IN({$id})";
$tmpquery2 = "DELETE FROM " . $tableCollab["assignments"] . " WHERE subtask IN({$id})";
/*
$tmpquery = "WHERE tas.id IN($id)";
$listTasks = new request();
$listTasks->openTasks($tmpquery);
$comptListTasks = count($listTasks->tas_id);
for ($i=0;$i<$comptListTasks;$i++) {
if ($fileManagement == "true") {
delDir("../files/".$listTasks->tas_project[$i]."/".$listTasks->tas_id[$i]);
}
}
*/
connectSql($tmpquery1);
connectSql($tmpquery2);
//recompute average completion of the task
taskComputeCompletion($listSubtasks->subtas_task[0], $tableCollab["tasks"]);
if ($task != "") {
headerFunction("../tasks/viewtask.php?id={$task}&msg=delete&" . session_name() . "=" . session_id());
exit;
} else {
headerFunction("../general/home.php?msg=delete&" . session_name() . "=" . session_id());
exit;
}
}
$tmpquery = "WHERE tas.id = '{$task}'";
$taskDetail = new request();
$taskDetail->openTasks($tmpquery);
$project = $taskDetail->tas_project[0];
$tmpquery = "WHERE pro.id = '{$project}'";
示例12: count
$comptATSEL = count($S_ATSEL);
for ($i = 0; $i < $comptATSEL; $i++) {
$mem_id1 = $S_ATSEL[$i];
$tmpquery3 = "INSERT INTO " . $tableCollab["attendants"] . "(project,meeting,member,published,authorized) VALUES('{$project}','{$num}','{$mem_id1}','{$pub}',1)";
connectSql("{$tmpquery3}");
if ($att_mem_id_list != "") {
$att_mem_id_list .= ", ";
}
$att_mem_id_list .= $mem_id1;
$mr = $mem_id1;
}
}
}
if ($mr != "0") {
$tmpquery4 = "UPDATE " . $tableCollab["meetings"] . " SET recorder='{$mr}' WHERE id = '{$num}'";
connectSql($tmpquery4);
}
if ($att_mem_id_list != "") {
// send meeting assignment mail if notifications = true
if ($notifications == "true") {
require_once "../meetings/noti_meetingassignment.php";
}
}
// create meeting sub-folder if filemanagement = true
if ($fileManagement == "true") {
createDir("files/{$project}/meetings");
createDir("files/{$project}/meetings/{$num}");
}
header("Location: ../meetings/viewmeeting.php?id={$num}&msg=addMeeting");
exit;
}
示例13: json_encode
if (ctype_digit($_GET["id"])) {
echo json_encode(db_select("StudentTutor", "google_id", $_GET["id"]));
} else {
echo "ERROR!!! You have included something strange with your request.";
}
} else {
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (db_select("StudentTutor", "google_id", $data["google_id"]) == NULL) {
db_insert("StudentTutor", $data);
}
} else {
if ($_SERVER["REQUEST_METHOD"] == "PUT") {
//db_update("StudentTutor", $data, "google_id");
if ($data["accept"] == true) {
//db_update("Request", $data, "id");
//queryrun("UPDATE Request SET accept=1 WHERE to_email='".$data["to_email"]."' AND from_email='".$data["from_email"]."' AND subject='".$data["subject"]."';", connectSql());
queryrun("UPDATE Request SET accept=1 WHERE id='" . $data["id"] . "';", connectSql());
} else {
if ($data["accept"] == false) {
//db_update("Request", $data, "id");
//queryrun("UPDATE Request SET accept=0 WHERE to_email='".$data["to_email"]."' AND from_email='".$data["from_email"]."' AND subject='".$data["subject"]."';", connectSql());
queryrun("UPDATE Request SET accept=0 WHERE id='" . $data["id"] . "';", connectSql());
} else {
//db_update("Request", $data, "id");
//queryrun("UPDATE Request SET accept=null WHERE to_email='".$data["to_email"]."' AND from_email='".$data["from_email"]."' AND subject='".$data["subject"]."';", connectSql());
queryrun("UPDATE Request SET accept=NULL WHERE id='" . $data["id"] . "';", connectSql());
}
}
}
}
}
示例14: connectSql
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Background</title>
</head>
<body>
<?php
include "sql.php";
include "class.php";
connectSql();
$seats = array();
$seats[0] = new bangku("A1", "Jonathan", "Taken", "4-Maret-2012", "lalalala");
echo $seats[0]->getNama();
$seats[0]->setNama("Hosea");
echo $seats[0]->getNama();
?>
</body>
</html>
示例15: connectSql
$logoDel = $_POST['logoDel'];
if ($logoDel == 'on') {
$tmpquery = 'UPDATE ' . $tableCollab['organizations'] . " SET extension_logo='' WHERE id='1'";
connectSql($tmpquery);
@unlink("../logos_clients/1.{$extensionOld}");
}
$extension = strtolower(substr(strrchr($_FILES['upload']['name'], '.'), 1));
if (@move_uploaded_file($_FILES['upload']['tmp_name'], "../logos_clients/1.{$extension}")) {
$tmpquery = 'UPDATE ' . $tableCollab['organizations'] . " SET extension_logo='{$extension}' WHERE id='1'";
connectSql($tmpquery);
}
$cn = convertData($cn);
$add = convertData($add);
$c = convertData($c);
$tmpquery = 'UPDATE ' . $tableCollab['organizations'] . " SET name='{$cn}',address1='{$add}',phone='{$wp}',url='{$url}',email='{$email}',comments='{$c}' WHERE id = '1'";
connectSql($tmpquery);
header('Location: ../administration/mycompany.php');
}
$tmpquery = "WHERE org.id='1'";
$clientDetail = new request();
$clientDetail->openOrganizations($tmpquery);
$cn = $clientDetail->org_name[0];
$add = $clientDetail->org_address1[0];
$wp = $clientDetail->org_phone[0];
$url = $clientDetail->org_url[0];
$email = $clientDetail->org_email[0];
$c = $clientDetail->org_comments[0];
//--- header ---------
$breadcrumbs[] = buildLink('../administration/admin.php?', $strings['administration'], LINK_INSIDE);
$breadcrumbs[] = $strings['company_details'];
$bodyCommand = 'onLoad="document.adminDForm.cn.focus();"';