本文整理汇总了PHP中server::connectToRealmDB方法的典型用法代码示例。如果您正苦于以下问题:PHP server::connectToRealmDB方法的具体用法?PHP server::connectToRealmDB怎么用?PHP server::connectToRealmDB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类server
的用法示例。
在下文中一共展示了server::connectToRealmDB方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: page
© Nomsoftware 'Nomsoft' 2011-2012. All rights reserved. */
$page = new page();
$server = new server();
$account = new account();
?>
<div class="box_right_title"><?php
echo $page->titleLink();
?>
» 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);
?>
示例2: Copyright
| __| | | | | | -_| | |_ -|
|_____|_|_|_|___|____/|___|\_/|___|
Copyright (C) 2013 EmuDevs <http://www.emudevs.com/>
*/
$page = new page();
$server = new server();
$account = new account();
$character = new character();
?>
<div class="box_right_title"><?php
echo $page->titleLink();
?>
» Manage Character</div>
Selected character: <?php
echo $account->getCharName($_GET['guid'], $_GET['rid']);
$server->connectToRealmDB($_GET['rid']);
$usersTotal = mysql_query("SELECT name,race,account,class,level,money,leveltime,totaltime,online,latency,gender FROM characters WHERE guid='" . $_GET['guid'] . "'");
$row = mysql_fetch_assoc($usersTotal);
?>
<hr/>
<table style="width: 100%;">
<tr>
<td>Character Name</td>
<td><input type="text" value="<?php
echo $row['name'];
?>
" class="noremove" id="editchar_name"/></td>
</tr>
<tr>
<td>Account</td>
<td><input type="text" value="<?php
示例3: VALUES
mysql_query("INSERT INTO account_access VALUES('" . $guid . "','" . $rank . "','" . $realm . "')");
$server->logThis("Added GM account access for " . ucfirst(strtolower($account->getAccName($guid))));
}
###############################
if ($_POST['action'] == 'editChar') {
$guid = (int) $_POST['guid'];
$rid = (int) $_POST['rid'];
$name = mysql_real_escape_string(trim(ucfirst(strtolower($_POST['name']))));
$class = (int) $_POST['class'];
$race = (int) $_POST['race'];
$gender = (int) $_POST['gender'];
$money = (int) $_POST['money'];
$accountname = mysql_real_escape_string($_POST['account']);
$accountid = $account->getAccID($accountname);
if (empty($guid) || empty($rid) || empty($name) || empty($class) || empty($race)) {
exit('Error');
}
$server->connectToRealmDB($rid);
$onl = mysql_query("SELECT COUNT(*) FROM characters WHERE guid='" . $guid . "' AND online=1");
if (mysql_result($onl, 0) > 0) {
exit('The character must be online for any change to take effect!');
}
mysql_query("UPDATE characters SET name='" . $name . "',class='" . $class . "',race='" . $race . "',gender='" . $gender . "', money='" . $money . "', account='" . $accountid . "'\n\tWHERE guid='" . $guid . "'");
echo 'The character was saved!';
$chk = mysql_query("SELECT COUNT(*) FROM characters WHERE name='" . $name . "'");
if (mysql_result($chk, 0) > 1) {
echo '<br/><b>NOTE:</b> It seems like there more than 1 character with this name, this might force them to rename when they log in.';
}
$server->logThis("Modified character data for " . $name);
}
###############################
示例4: getCharName
public function getCharName($id, $realm_id)
{
$server = new server();
$server->connectToRealmDB($realm_id);
$result = mysql_query("SELECT name FROM characters WHERE guid='" . (int) $id . "'");
if (mysql_num_rows($result) == 0) {
return '<i>Unknown</i>';
} else {
$row = mysql_fetch_assoc($result);
if (empty($row['name'])) {
return '<i>Unknown</i>';
} else {
return $row['name'];
}
}
}