本文整理汇总了PHP中dbSelect函数的典型用法代码示例。如果您正苦于以下问题:PHP dbSelect函数的具体用法?PHP dbSelect怎么用?PHP dbSelect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dbSelect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCaptchaCode
function getCaptchaCode($id)
{
$ecCaptchaData = dbSelect('*', 1, 'captcha', 'captchaId=' . $id);
while ($captcha = mysql_fetch_object($ecCaptchaData)) {
return $captcha->captchaCode;
}
}
示例2: getEdgesForBox
public function getEdgesForBox($bottom_left, $top_right, $middle, $count, $countries = null, $edge_types = null)
{
$country_one = $this->_buildBounder('country_one', $bottom_left, $top_right, $middle);
$country_two = $this->_buildBounder('country_two', $bottom_left, $top_right, $middle);
$sql = "SELECT country_one.id as country_one_id, country_one.name as country_one_name, country_one.lat as country_one_lat, country_one.long as country_one_long, " . "country_two.id as country_two_id, country_two.name as country_two_name, country_two.lat as country_two_lat, country_two.long as country_two_long, " . "SQRT(POW(ABS(country_one.lat-country_two.lat), 2)+POW(ABS(country_one.long-country_two.long), 2)) * edge_type.weight distance " . "FROM edge " . "JOIN countries AS country_one ON (edge.country_one=country_one.id) " . "JOIN countries AS country_two ON (edge.country_two=country_two.id) " . "JOING edge_type on (edge.edge_type=edge_type.id) " . "WHERE " . $country_one . ' and ' . $country_two . ' ' . ($countries ? 'and (edge.country_one in (' . implode(',', $countries) . ') or edge.country_two in (' . implode(',', $countries) . ')) ' : '') . ($edge_types ? 'and edge.edge_type IN (' . implode(',', $edge_types) . ') ' : '') . "group by country_one_id, country_two_id, country_one_name, country_one_lat, country_one_long, country_two_name, country_two_lat, country_two_long, distance " . "order by distance desc limit {$count}";
$items = dbSelect($sql);
$return = array();
foreach ($items as $item) {
$sql = 'SELECT edge.url, edge.title, edge_type.name as type ' . 'FROM edge JOIN edge_type ON (edge.edge_type=edge_type.id) ' . 'WHERE edge.country_one=' . $item['country_one_id'] . ' ' . 'and edge.country_two=' . $item['country_two_id'];
$edges = dbSelect($sql);
$types = array();
$colours = array('angry' => '#c8050c', 'happy' => '#00b495', 'sport' => '#00a235', 'business' => '#538aad', 'pirates' => '#1a5690');
foreach ($edges as $i => $edge) {
if (!isset($types[$edge['type']])) {
$types[$edge['type']] = 1;
} else {
$types[$edge['type']]++;
}
$edges[$i]['source'] = $this->_getSource($edge['url']);
}
list($type, $count) = each($types);
$return_item = array('countries' => array(array('id' => $item['country_one_id'], 'name' => $item['country_one_name'], 'lat' => $item['country_one_lat'], 'long' => $item['country_one_long']), array('id' => $item['country_two_id'], 'name' => $item['country_two_name'], 'lat' => $item['country_two_lat'], 'long' => $item['country_two_long'])), 'colour' => $colours[$type], 'edges' => $edges);
$return[] = $return_item;
}
return $return;
}
示例3: dbConnect
function dbConnect()
{
//Connection to database
$dbHost = 'localhost';
$dbUser = 'hot_thess';
$dbPass = 'hot_thess1234';
$dbName = 'hot_thess';
$connection = mysqli_connect($dbHost, $dbUser, $dbPass, $dbName) or die('Error Connecting to MySQL DataBase');
mysqli_set_charset($connection, "utf8");
$data = file_get_contents('php://input');
$data = json_decode($data, true);
dbSelect($connection, $data);
}
示例4: ecBBBodeField
function ecBBBodeField($name, $textfield, $fieldvalue)
{
global $ecSettings;
$i = 0;
$maxsmileyscount = $ecSettings['bbcode']['smileycount'] - 1;
$GLOBALS['bbSmileys'] = '';
$ecBBCodeData = dbSelect('*', 1, 'bbcode', "view = 1");
while ($bbcode = mysql_fetch_object($ecBBCodeData)) {
$GLOBALS['code'] = $bbcode->code;
$GLOBALS['bbSmileys'] .= ecTemplate('bbcode', 'textfield', 'smiley');
if ($i == $maxsmileyscount) {
$i = 0;
$GLOBALS['bbSmileys'] .= '<br />';
} else {
$i++;
}
}
return ecTemplate('bbcode', 'textfield', 'textfield');
}
示例5: setMeta
/**
* Sets meta information about the student
*
* Collects any meta information for the student from the meta database table, so that it can
* be shown on the box at the top of the window. This information is stored in an array, which
* can be accessed as and when by the getMeta function
*
* @see getMeta
* @param int $studentID The ID of the student passed to this file
* @param mixed $databaseConnection A link to the current database connection
* @returns array An array of student meta information
*/
function setMeta($studentID, $databaseConnection)
{
// Array to hold the information about the student, which is returned when the function ends
$metaInformation = array();
// Making sure that there is an ID for the student passed
if (!empty($studentID)) {
// Sanitising the query
$studentID = $databaseConnection->real_escape_string($studentID);
$metaInformation["studentID"] = $studentID;
// Getting the name of the student
$sqlStudentName = "SELECT StudentForename, StudentSurname FROM `sen_info`.`tbl_students` WHERE (studentID = {$studentID})";
$queryResultStudentName = dbSelect($sqlStudentName, $databaseConnection);
// Seeing if any results were found, and filling in the meta information array
if (dbSelectCountRows($queryResultStudentName) > 0) {
foreach (dbSelectGetRows($queryResultStudentName) as $row) {
$metaInformation["studentForename"] = $row['StudentForename'];
$metaInformation["studentSurname"] = $row['StudentSurname'];
}
}
// Getting additional meta information about the student
$sqlStudentMeta = "SELECT * FROM `sen_info`.`tbl_student_meta` WHERE (studentID = {$studentID})";
$queryResultStudentMeta = dbSelect($sqlStudentMeta, $databaseConnection);
// Seeing if any results were found, and filling in the meta information array
if (dbSelectCountRows($queryResultStudentMeta) > 0) {
foreach (dbSelectGetRows($queryResultStudentMeta) as $row) {
$metaInformation["yearGroup"] = $row['YearGroup'];
$metaInformation["house"] = $row['House'];
$metaInformation["form"] = $row['Form'];
$metaInformation["dob"] = $row['DoB'];
$metaInformation["comment"] = $row['Comment'];
// Note: Any additional rows added to the meta table should be added here
}
}
}
// Return any meta information that has been collected
return $metaInformation;
}
示例6: dbSelect
<?php
require_once '../includes/config.php';
$location = $_SESSION['location'];
if (isset($_POST['search_button'])) {
$keyword = $_POST['search_keyword'];
$jobResult = dbSelect(JOB_TABLE, "WHERE job_title LIKE '%" . $keyword . "%' or job_keyword LIKE '%" . $keyword . "%' or job_description LIKE '%" . $keyword . "%'");
$num_rows = mysql_num_rows($jobResult);
if ($num_rows == 0) {
echoNoResult();
} else {
echoDiv($jobResult);
}
} else {
if (strrpos($location, "jobPortal.php")) {
$jobResult = dbSelect(JOB_TABLE, "ORDER BY job_id DESC");
$num_rows = mysql_num_rows($jobResult);
if ($num_rows == 0) {
echoNoResult();
} else {
echoDiv($jobResult);
}
}
}
function echoDiv($jobResult)
{
echo "<div class=\"jobList\">\r\n <table class=\"jobTable\" style=\"width:100%;\">\r\n <tr class=\"tableLabel\">\r\n <td class=\"jobTitle\">POSITION</td>\r\n <td class=\"jobCompany\">COMPANY</td>\r\n <td class=\"jobDescription\">DESCRIPTION</td>\r\n <td class=\"jobStatus\">CLOSE DATE</td>\r\n </tr>";
$count = 0;
while ($row = mysql_fetch_assoc($jobResult)) {
$today = date("Y-m-d");
$today = intval(str_replace('-', '', $today));
示例7: fieldPlays
function fieldPlays($method, $target, $payload)
{
switch ($method) {
case "GET":
checkNULL($target, 'device');
checkDevice($target, 'has_device');
$result = dbSelect('devices', 'devicetime', "tag='" . $target . "'");
$response = $result->fetch_assoc();
httpResponse($response, 200);
break;
case "POST":
checkNULL($target, 'room');
checkRoom($target, 'has_room');
checkNULL($payload['user'], 'user');
checkOnline($payload['user']);
dbUpdate('devices', "command='" . $payload['cmd'] . "', timestamp='" . $payload['ts'] . "'", "location='" . $target . "'");
echoSuccess("set_play");
break;
case "PUT":
checkNULL($target, 'device');
checkDevice($target, 'has_device');
dbUpdate('devices', "devicetime='" . $payload['dt'] . "'", "tag='" . $target . "'");
$result = dbSelect('devices', 'command, timestamp', "tag='" . $target . "'");
$response = $result->fetch_assoc();
httpResponse($response, 200);
dbUpdate('devices', "command=''", "tag='" . $target . "'");
break;
case "DELETE":
checkNULL($target, 'room');
checkRoom($target, 'has_room');
dbUpdate('devices', "command='', timestamp=''", "location='" . $target . "'");
echoSuccess("reset_play");
break;
default:
echoError('Invalid Method');
break;
}
}
示例8: ecTemplate
$description = $groups->groupsName;
$checked = '';
if ($_POST['usersGroupId'] == $groups->groupsId) {
$checked = ' selected="selected"';
}
$dataGroups .= ecTemplate('users', 'edit', 'select');
}
echo ecTemplate('users', 'edit', 'usersEdit');
}
} else {
$ecUsersData = dbSelect('*', 1, 'users', "usersId = {$id}");
while ($users = mysql_fetch_object($ecUsersData)) {
$usersUsername = $users->usersUsername;
$usersEmail = $users->usersEmail;
$usersFirstname = $users->usersFirstname;
$usersLastname = $users->usersLastname;
$dataGroups = '';
$ecGroupsData = dbSelect('groupsName,groupsId', 1, 'groups');
while ($groups = mysql_fetch_object($ecGroupsData)) {
$value = $groups->groupsId;
$description = $groups->groupsName;
$checked = '';
if ($users->usersGroupId == $groups->groupsId) {
$checked = ' selected="selected"';
}
$dataGroups .= ecTemplate('users', 'edit', 'select');
}
$errorMsg = '';
echo ecTemplate('users', 'edit', 'usersEdit');
}
}
示例9: dbSelect
$ecAccessData = dbSelect('*', 1, 'access', 'accessGroupId=' . $id);
while ($access = mysql_fetch_object($ecAccessData)) {
array_push($tmpAccess, $access->accessSiteId);
}
$ecSitesData = dbSelect('*', 1, 'sites');
while ($sites = mysql_fetch_object($ecSitesData)) {
$sitesId = $sites->sitesId;
if (!in_array($sitesId, $tmpAccess)) {
$insert['accessGroupId'] = $id;
$insert['accessSiteId'] = $sitesId;
$insert['accessLevel'] = 0;
dbInsert(1, 'access', $insert);
}
}
echo ecTemplate('groups', 'access', 'accessHead');
$ecAccessData = dbSelect('pluginsId, pluginsPath, pluginsName, sitesName, accessSiteId, sitesPluginId, sitesId, accessLevel', 1, 'plugins,sites,access', "(sitesId = accessSiteId) AND (sitesPluginId = pluginsId) AND (accessGroupId = {$id})", 'pluginsId');
while ($access = mysql_fetch_object($ecAccessData)) {
$pluginId = $access->pluginsId;
$plugin = $access->pluginsName;
$pluginPath = $access->pluginsPath;
if (!isset($actPlug)) {
$actPlug = $pluginId;
echo ecTemplate('groups', 'access', 'accessPluginHead');
}
if ($pluginId != $actPlug) {
echo ecTemplate('groups', 'access', 'accessPluginFoot');
$plugin = $access->pluginsName;
$actPlug = $pluginId;
echo ecTemplate('groups', 'access', 'accessPluginHead');
}
$site = $access->sitesName;
示例10: create
public static function create()
{
$finder = new self();
$finder->setCountryTags(dbSelect("SELECT * FROM countries JOIN country_tags ON (countries.id=country_tags.country_id)"));
return $finder;
}
示例11: dbSelect
<!DOCTYPE html>
<html>
<body>
<?php
require_once '../model/db.php';
$CV_id = $_GET['cv'];
$job_id = $_GET['job'];
# Fetch the job keywords
$result = dbSelect(JOB_TABLE, "WHERE job_id = " . $job_id);
$row = mysql_fetch_assoc($result);
$job_keyword = $row['job_keyword'];
$job_keyword_string = explode(",", $job_keyword);
$importance = $row['keyword_importance'];
$importance_string = explode(",", $importance);
$fullMark = 0;
foreach ($job_keyword_string as $index => $keyword) {
$job_keyword_arr[$keyword] = $importance_string[$index];
$fullMark += $importance_string[$index];
}
# Extract the cv information
$cv_description = $_SESSION['cv_description'][$CV_id];
$cv_email = findEmail($cv_description);
$cv_phone = findPhoneNumber($cv_description);
$cv_name = findName($cv_description);
$result = matchingJobAndCV($cv_description, $job_keyword_arr);
foreach ($result as $key => $value) {
$matched_keyword = $key;
$grade = $value;
}
$percentage = round($grade / $fullMark * 100, 2);
# Update the cv information in database
示例12: Nutzung
Unbrechtigte Nutzung (Verkauf, Weiterverbreitung,
Nutzung ohne Urherberrechtsvermerk, kommerzielle
Nutzung) ist strafbar.
Die Nutzung des Scriptes erfolgt auf eigene Gefahr.
Schäden die durch die Nutzung entstanden sind,
trägt allein der Nutzer des Programmes.
*/
$ecFile = 'plugins/squads/taskedit.php';
echo ecTemplate('squads', 'taskedit', 'siteHead');
$ecLang = ecGetLang('squads', 'taskedit');
$id = $_REQUEST['id'];
if (isset($_POST['save'])) {
if (!empty($_POST['taskName'])) {
$update['squadtaskName'] = $_POST['taskName'];
$update['squadtaskPriority'] = $_POST['taskPriority'];
dbUpdate(1, 'squadtask', $update, "squadtaskId = {$id}");
$next = ecReferer('index.php?view=squads&site=manage');
echo ecTemplate('squads', 'taskedit', 'taskEdited');
} else {
$errorMsg = $ecLang['errorEmpty'];
echo ecTemplate('squads', 'taskedit', 'taskEdit');
}
} else {
$ecTaskData = dbSelect('*', 1, 'squadtask', "squadtaskId = {$id}");
while ($tasks = mysql_fetch_object($ecTaskData)) {
$taskName = $tasks->squadtaskName;
$taskPriority = $tasks->squadtaskPriority;
$errorMsg = '';
echo ecTemplate('squads', 'taskedit', 'taskEdit');
}
}
示例13: Nutzung
Dieses Programm ist urheberrechtlich geschützt.
Die Verwendung für private Zwecke ist gesattet.
Unbrechtigte Nutzung (Verkauf, Weiterverbreitung,
Nutzung ohne Urherberrechtsvermerk, kommerzielle
Nutzung) ist strafbar.
Die Nutzung des Scriptes erfolgt auf eigene Gefahr.
Schäden die durch die Nutzung entstanden sind,
trägt allein der Nutzer des Programmes.
*/
$ecFile = 'plugins/users/changepassword.php';
echo ecTemplate('users', 'changepassword', 'siteHead');
$ecLang = ecGetLang('users', 'changepassword');
if (isset($_POST['save'])) {
if (!empty($_POST['usersOldPassword']) && !empty($_POST['usersNewPassword']) && !empty($_POST['usersNewPassword2'])) {
if ($_POST['usersNewPassword'] == $_POST['usersNewPassword2']) {
$ecUsersData = dbSelect('*', 1, 'users', "usersId=" . $ecUser['userId']);
while ($users = mysql_fetch_object($ecUsersData)) {
if ($users->usersPassword == ecCrypt($_POST['usersOldPassword'])) {
$update['usersPassword'] = ecCrypt($_POST['usersNewPassword']);
dbUpdate(1, 'users', $update, "usersId = " . $ecUser['userId']);
$next = ecReferer('index.php?view=users&site=usercenter');
echo ecTemplate('users', 'changepassword', 'usersEdited');
} else {
$errorMsg = $ecLang['errorOldPassword'];
echo ecTemplate('users', 'changepassword', 'usersEdit');
}
}
} else {
$errorMsg = $ecLang['errorPassword'];
echo ecTemplate('users', 'changepassword', 'usersEdit');
}
示例14: array
$clanwarsSquadImg = !empty($clanwar['squadsPic']) ? $clanwar['squadsPic'] : 'default.png';
$clanwarsGameId = $clanwar['gamesId'];
$clanwarsGameName = $clanwar['gamesName'];
$clanwarsGameImg = $clanwar['gamesIcon'];
$clanwarsEnemyId = $clanwar['clandbId'];
$clanwarsEnemyName = $clanwar['clandbName'];
$clanwarsInfo = $clanwar['clanwarsInfo'];
$clanwarsEnemyImg = !empty($clanwar['clandbImage']) ? $clanwar['clandbImage'] : 'default.png';
$cwTypes = array(1 => 'Clanwar', 2 => 'Funwar', 3 => 'Friendlywar', 4 => 'Trainwar', 5 => 'Ligawar', 6 => 'Other');
$clanwarsTyp = $cwTypes[$clanwar['clanwarsTypId']];
$clanwarsSquadNation = $ecSettings['squads']['clanNation'];
$clanwarsEnemyNation = $clanwar['clandbCountry'];
$squadLineup = '';
$clanwarsSquadPlayerCount = 0;
$squadPlayer = explode("|µ|", $clanwar['clanwarsSquadListId']);
$ecSquadData = dbSelect('squadplayerId,usersId,usersUsername,squadsTag,usersNation', 1, 'squadplayer,squadtask,users,squads', "(squadplayerTaskId = squadtaskID) AND (squadplayerUserId = usersId) AND (squadsId = squadplayerSquadId)");
while ($player = mysql_fetch_object($ecSquadData)) {
if (in_array($player->squadplayerId, $squadPlayer)) {
$name = $player->squadsTag . $player->usersUsername;
$nation = $player->usersNation;
$userId = $player->usersId;
$squadLineup .= ecTemplate('clanwars', 'details', 'squadLineup');
$clanwarsSquadPlayerCount++;
}
}
$clanwarsEnemyPlayerCount = 0;
$enemyLineup = '';
$enemySquadPlayer = explode("|µ|", $clanwar['clanwarsListEnemy']);
foreach ($enemySquadPlayer as $nick) {
if (!empty($nick)) {
$name = $clanwar['clandbTag'] . $nick;
示例15: while
while ($clans = mysql_fetch_object($ecEnemyClanData)) {
$name = $clans->clandbName;
$value = $clans->clandbId;
$clanwarsEnemyClans .= ecTemplate('clanwars', 'add', 'select');
}
// Squads
$clanwarsSquads = '';
$clanwarsSquadPlayer = '';
$ecSquadsData = dbSelect('*', 1, 'squads');
while ($squads = mysql_fetch_object($ecSquadsData)) {
$value = $squads->squadsId;
$name = $squads->squadsName;
$clanwarsSquads .= ecTemplate('clanwars', 'add', 'select');
// Players
$squadNames = '';
$ecPlayerData = dbSelect('*', 1, 'squadplayer,users', "(squadplayerSquadId = {$value}) AND (squadplayerUserId = usersId)");
while ($player = mysql_fetch_object($ecPlayerData)) {
$playerId = $player->squadplayerId;
$playerName = $player->usersUsername;
$squadNames .= ecTemplate('clanwars', 'add', 'squadPlayer');
}
$clanwarsSquadPlayer .= ecTemplate('clanwars', 'add', 'squadView');
}
// Years
$clanwarsYears = '';
foreach (ecMakeYear() as $value) {
$name = $value;
$clanwarsYears .= ecTemplate('clanwars', 'add', 'select');
}
// Upload Filetypes
$uploadPictures = $ecSettings['clanwars']['pics'] == 1 ? $ecLang['picturesTypes'] : '';