本文整理汇总了PHP中server::selectDB方法的典型用法代码示例。如果您正苦于以下问题:PHP server::selectDB方法的具体用法?PHP server::selectDB怎么用?PHP server::selectDB使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类server
的用法示例。
在下文中一共展示了server::selectDB方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: server
__ __ _
/\ \ \___ _ __ ___ ___ ___ / _| |_
/ \/ / _ \| '_ ` _ \/ __|/ _ \| |_| __|
/ /\ / (_) | | | | | \__ \ (_) | _| |_
\_\ \/ \___/|_| |_| |_|___/\___/|_| \__| - www.Nomsoftware.com -
The policy of Nomsoftware states: Releasing our software
or any other files are protected. You cannot re-release
anywhere unless you were given permission.
© Nomsoftware 'Nomsoft' 2011-2012. All rights reserved. */
define('INIT_SITE', TRUE);
include '../../includes/misc/headers.php';
include '../../includes/configuration.php';
include '../functions.php';
$server = new server();
$account = new account();
$server->selectDB('webdb');
###############################
if ($_POST['action'] == 'addsingle') {
$entry = (int) $_POST['entry'];
$price = (int) $_POST['price'];
$shop = mysql_real_escape_string($_POST['shop']);
if (empty($entry) || empty($price) || empty($shop)) {
die("Please enter all fields.");
}
$server->selectDB('worlddb');
$get = mysql_query("SELECT name,displayid,ItemLevel,quality,AllowableRace,AllowableClass,class,subclass,Flags\r\n\tFROM item_template WHERE entry='" . $entry . "'") or die('Error whilst getting item data from the database. Error message: ' . mysql_error());
$row = mysql_fetch_assoc($get);
$server->selectDB('webdb');
if ($row['AllowableRace'] == "-1") {
$faction = 0;
} elseif ($row['AllowableRace'] == 690) {
示例2: while
?>
<div class="box_right_title">Account Access</div>
All GM accounts are listed below.
<br/>
<table>
<tr>
<th>ID</th>
<th>Username</th>
<th>Rank</th>
<th>Realms</th>
<th>Status</th>
<th>Last Login</th>
<th>Actions</th>
</tr>
<?php
$server->selectDB('logondb');
$result = mysql_query("SELECT * FROM account_access");
if (mysql_num_rows($result) == 0) {
echo "<b>No GM accounts found!</b>";
} else {
while ($row = mysql_fetch_assoc($result)) {
?>
<tr style="text-align:center;">
<td><?php
echo $row['id'];
?>
</td>
<td><?php
echo $account->getAccName($row['id']);
?>
</td>
示例3: scandir
echo $file . ' (Module)<br/>';
}
}
//Pages
$folder = scandir('../plugins/' . $filename . '/pages/');
foreach ($folder as $file) {
if (!in_array($file, $bad)) {
echo $file . ' (Page)<br/>';
}
}
//Styles
$folder = scandir('../plugins/' . $filename . '/styles/');
foreach ($folder as $file) {
if (!in_array($file, $bad)) {
echo $file . ' (Stylesheet)<br/>';
}
}
//Javascript
$folder = scandir('../plugins/' . $filename . '/javascript/');
foreach ($folder as $file) {
if (!in_array($file, $bad)) {
echo $file . ' (Javascript)<br/>';
}
}
$server->selectDB('webdb');
$chk = mysql_query("SELECT COUNT(*) FROM disabled_plugins WHERE foldername='" . mysql_real_escape_string($filename) . "'");
if (mysql_result($chk, 0) > 0) {
echo '<input type="submit" value="Enable Plugin" onclick="enablePlugin(\'' . $filename . '\')">';
} else {
echo '<input type="submit" value="Disable Plugin" onclick="disablePlugin(\'' . $filename . '\')">';
}
示例4: while
» Manage Users</div>
<?php
if (isset($_GET['char'])) {
echo 'Search results for <b>' . $_GET['char'] . '</b><pre>';
$result = mysql_query("SELECT name, id FROM realms");
while ($row = mysql_fetch_assoc($result)) {
$server->connectToRealmDB($row['id']);
$get = mysql_query("SELECT account,name FROM characters WHERE name='" . mysql_real_escape_string($_GET['char']) . "' OR guid='" . (int) $_GET['char'] . "'");
$rows = mysql_fetch_assoc($get);
echo '<a href="?p=users&s=manage&user=' . $rows['account'] . '">' . $rows['name'] . ' - ' . $row['name'] . '</a><br/>';
}
echo '</pre><hr/>';
}
if (isset($_GET['user'])) {
$server->selectDB('logondb');
$value = mysql_real_escape_string($_GET['user']);
$result = mysql_query("SELECT * FROM account WHERE username='" . $value . "' OR id='" . $value . "'");
if (mysql_num_rows($result) == 0) {
echo "<span class='red_text'>No results found!</span>";
} else {
$row = mysql_fetch_assoc($result);
?>
<table width="100%">
<tr>
<td><span class='blue_text'>Account name</span></td><td> <?php
echo ucfirst(strtolower($row['username']));
?>
(<?php
echo $row['last_ip'];
?>
示例5: addSlideImage
public function addSlideImage($upload, $path, $url)
{
$path = mysql_real_escape_string($path);
$url = mysql_real_escape_string($url);
if (empty($path)) {
//No path set, upload image.
if ($upload['error'] > 0) {
echo "<span class='red_text'><b>Error:</b> File uploading was not successfull!</span>";
$abort = true;
} else {
if ($upload["type"] == "image/gif" || $upload["type"] == "image/jpeg" || $upload["type"] == "image/pjpeg" || $upload["type"] == "image/png") {
if (file_exists("../styles/global/slideshow/images/" . $upload["name"])) {
unlink("../styles/global/slideshow/images/" . $upload["name"]);
move_uploaded_file($upload["tmp_name"], "../styles/global/slideshow/images/" . $upload["name"]);
$path = "styles/global/slideshow/images/" . $upload["name"];
} else {
move_uploaded_file($upload["tmp_name"], "../styles/global/slideshow/images/" . $upload["name"]);
$path = "styles/global/slideshow/images/" . $upload["name"];
}
} else {
$abort = true;
}
}
} else {
$path = $path;
}
if (!isset($abort)) {
$server = new server();
$server->selectDB('webdb');
mysql_query("INSERT INTO slider_images VALUES('','" . $path . "','" . $url . "')");
}
}
示例6: server
__ __ _
/\ \ \___ _ __ ___ ___ ___ / _| |_
/ \/ / _ \| '_ ` _ \/ __|/ _ \| |_| __|
/ /\ / (_) | | | | | \__ \ (_) | _| |_
\_\ \/ \___/|_| |_| |_|___/\___/|_| \__| - www.Nomsoftware.com -
The policy of Nomsoftware states: Releasing our software
or any other files are protected. You cannot re-release
anywhere unless you were given permission.
© Nomsoftware 'Nomsoft' 2011-2012. All rights reserved. */
define('INIT_SITE', TRUE);
include '../../includes/misc/headers.php';
include '../../includes/configuration.php';
include '../functions.php';
$server = new server();
$account = new account();
$server->selectDB('webdb');
##############################
if ($GLOBALS['core_expansion'] == 3) {
$guidString = 'playerGuid';
} else {
$guidString = 'guid';
}
if ($GLOBALS['core_expansion'] == 3) {
$closedString = 'closed';
} else {
$closedString = 'closedBy';
}
if ($GLOBALS['core_expansion'] == 3) {
$ticketString = 'guid';
} else {
$ticketString = 'ticketId';