本文整理汇总了PHP中query_numrows函数的典型用法代码示例。如果您正苦于以下问题:PHP query_numrows函数的具体用法?PHP query_numrows怎么用?PHP query_numrows使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了query_numrows函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mysql_real_escape_string
$task = mysql_real_escape_string($_GET['task']);
}
}
switch (@$task) {
case 'deletelog':
query_basic("TRUNCATE `" . DBPREFIX . "log`");
$_SESSION['msg1'] = T_('Activity Logs Deleted Successfully!');
$_SESSION['msg2'] = T_('All activity logs have been removed.');
$_SESSION['msg-type'] = 'success';
header("Location: utilitieslog.php");
die;
break;
case 'dumplogtxt':
$output = '';
$date = formatDate(date('Y-m-d H:i:s'));
$numLogs = query_numrows("SELECT * FROM `" . DBPREFIX . "log` ORDER BY `logid`");
//---------------------------------------------------------+
$output .= "\n//==================================================================================\n//\n//\tBRIGHT GAME PANEL ACTIVITY LOGS DUMP\n//\n//==================================================================================\n//\n//\tFILENAME: bgp-activity-logs-" . date('Y-m-d') . "\n//\tDATE: {$date}\n//\tADMIN USERNAME: {$_SESSION['adminusername']}\n//\tADMIN FIRSTNAME: {$_SESSION['adminfirstname']}\n//\tADMIN LASTNAME: {$_SESSION['adminlastname']}\n//\n//\tNUMBER OF LOGS: {$numLogs}\n//\tORDERED BY: LOGID\n//\n//==================================================================================\n//\n//\tNOTES:\n//\n//\t\tTimestamp Format: date(Y-m-d H:i:s)\n//\n//==================================================================================\n";
//---------------------------------------------------------+
$output .= "\n" . str_pad("LOGID:", 8) . str_pad("Message:", 100) . str_pad("Name:", 24) . str_pad("IP:", 20) . str_pad("Timestamp:", 19) . "\n";
//---------------------------------------------------------+
$logs = mysql_query("SELECT * FROM `" . DBPREFIX . "log` ORDER BY `logid` DESC");
while ($rowsLogs = mysql_fetch_assoc($logs)) {
//---------------------------------------------------------+
$output .= str_pad($rowsLogs['logid'], 8) . str_pad($rowsLogs['message'], 100) . str_pad($rowsLogs['name'], 24) . str_pad($rowsLogs['ip'], 20) . str_pad($rowsLogs['timestamp'], 19) . "\n";
//---------------------------------------------------------+
}
//---------------------------------------------------------+
$output .= "\n//==================================================================================\n//\tEND\n//==================================================================================\n";
//---------------------------------------------------------+
header('Content-type: text/plain');
示例2: T_
?>
"><?php
echo T_('Game File Repositories');
?>
</a></li>
<li><a href="boxlog.php?id=<?php
echo $boxid;
?>
"><?php
echo T_('Activity Logs');
?>
</a></li>
</ul>
<div id="charts">
<?php
if (query_numrows("SELECT `timestamp`, `cache` FROM `" . DBPREFIX . "boxData` WHERE `timestamp` >= '" . (time() - (60 * 60 * 24 * 7 * 4 + CRONDELAY)) . "'") != 0) {
?>
<script type="text/javascript">
// Chart Containers
var players;
var top;
var bw_usage;
var bw_consumption;
$(document).ready(function() {
//------------------------------------------------------------------------------------------------------------+
/**
* PLAYERS
*/
//------------------------------------------------------------------------------------------------------------+
$(function() {
示例3: T_
###
$_SESSION['msg1'] = T_('Admin Updated Successfully!');
$_SESSION['msg2'] = T_('Your changes to the admin have been saved.');
$_SESSION['msg-type'] = 'success';
header("Location: configadmin.php");
die;
break;
case 'configadmindelete':
$adminid = $_GET['id'];
###
$error = '';
###
if (!is_numeric($adminid)) {
$error .= T_('Invalid AdminID. ');
} else {
if (query_numrows("SELECT `adminid` FROM `" . DBPREFIX . "admin` WHERE `adminid` = '" . $adminid . "'") == 0) {
$error .= T_('Invalid AdminID. ');
}
}
if ($adminid == $_SESSION['adminid']) {
$error .= T_('You cannot delete yourself!');
}
###
if (!empty($error)) {
$_SESSION['msg1'] = T_('Validation Error!');
$_SESSION['msg2'] = $error;
$_SESSION['msg-type'] = 'error';
unset($error);
header("Location: index.php");
die;
}
示例4: while
while ($rowsCategoriesNav = mysql_fetch_assoc($categoriesNav)) {
?>
<li class="dropdown-submenu">
<a tabindex="-1" href="#"><i class="icon-th-large <?php
echo formatIcon();
?>
"></i> <?php
echo htmlspecialchars($rowsCategoriesNav['name'], ENT_QUOTES);
?>
</a>
<ul class="dropdown-menu">
<?php
/**
* Processing Scripts
*/
if (query_numrows("SELECT `scriptid` FROM `" . DBPREFIX . "script` WHERE `catid` = '" . $rowsCategoriesNav['id'] . "' AND `status` = 'Active'") != 0) {
$scriptsNav = mysql_query("SELECT `scriptid`, `boxid`, `catid`, `groupid`, `name` FROM `" . DBPREFIX . "script` WHERE ( `catid` = '" . $rowsCategoriesNav['id'] . "' AND `status` = 'Active' ) ORDER BY `name`");
while ($rowsScriptsNav = mysql_fetch_assoc($scriptsNav)) {
if (checkClientGroup($rowsScriptsNav['groupid'], $_SESSION['clientid']) != FALSE) {
?>
<li>
<a tabindex="-1" href="scriptsummary.php?id=<?php
echo $rowsScriptsNav['scriptid'];
?>
">
<i class="icon-arrow-right <?php
echo formatIcon();
?>
"></i>
<?php
echo htmlspecialchars($rowsScriptsNav['name'], ENT_QUOTES);
示例5: switch
//----------------------------------------------------+
switch (@$task) {
case 'processlogin':
if (isLoggedIn() == TRUE) {
$_SESSION = array();
session_destroy();
}
$username = mysql_real_escape_string($_POST['username']);
$password = mysql_real_escape_string($_POST['password']);
###
if (!empty($username) && !empty($password)) {
###
$salt = hash('sha512', $username);
$password = hash('sha512', $salt . $password);
###
$numrows = query_numrows("SELECT * FROM `user` WHERE `username` = '" . $username . "' AND `password` = '" . $password . "'");
if ($numrows == 1) {
$rows = query_fetch_assoc("SELECT * FROM `user` WHERE `username` = '" . $username . "' AND `password` = '" . $password . "'");
###
$_SESSION['id'] = $rows['id'];
$_SESSION['username'] = $rows['username'];
###
validate();
###
$_SESSION['msg1'] = 'Zostałeś poprawnie zalogowany!';
$_SESSION['msg-type'] = 'success';
header("Location: admin.php?page=1");
die;
}
}
$_SESSION['msg1'] = 'Błędny login lub złe hasło!';
示例6: exit
$clientid = $_GET['id'];
} else {
exit('Error: ClientID error.');
}
###
$return = 'clientlog.php?id=' . urlencode($clientid);
require "../configuration.php";
require "./include.php";
$title = T_('Client Activity Logs');
if (query_numrows("SELECT `username` FROM `" . DBPREFIX . "client` WHERE `clientid` = '" . $clientid . "'") == 0) {
exit('Error: ClientID is invalid.');
}
$rows = query_fetch_assoc("SELECT `firstname`, `lastname`, `status` FROM `" . DBPREFIX . "client` WHERE `clientid` = '" . $clientid . "' LIMIT 1");
//---------------------------------------------------------+
//Num Pages Process:
$numLogs = query_numrows("SELECT * FROM `" . DBPREFIX . "log` WHERE `clientid` = '" . $clientid . "' ORDER BY `logid` LIMIT 750");
$numPages = ceil($numLogs / 50);
//---------------------------------------------------------+
//Pages Process:
if (isset($_GET['page'])) {
$page = mysql_real_escape_string($_GET['page']);
} else {
$page = 1;
}
//Security
if ($page > 15 || !is_numeric($page)) {
exit('Page error!');
}
//---------------------------------------------------------+
//Logs:
$logs = mysql_query("SELECT * FROM `" . DBPREFIX . "log` WHERE `clientid` = '" . $clientid . "' ORDER BY `logid` DESC LIMIT " . ($page - 1) * 50 . ", 50");
示例7: mysql_real_escape_string
$id = mysql_real_escape_string($_POST['id']);
} else {
if (isset($_GET['id'])) {
$id = mysql_real_escape_string($_GET['id']);
}
}
###
$error = '';
###
if (empty($id)) {
$error .= 'Brak id. ';
}
if (!is_numeric($id)) {
$error .= 'Id vouchera jest nieprawidłowe. ';
}
if (query_numrows("SELECT `code` FROM `voucher` WHERE `id` = '" . $id . "'") == 0) {
$error .= 'Taki voicher nie istnieje. ';
}
###
if (!empty($error)) {
$_SESSION['msg1'] = $error;
$_SESSION['msg-type'] = 'danger';
unset($error);
header("Location: admin.php?page=5");
die;
}
###
query_basic("DELETE FROM `voucher` WHERE `id` = '" . $id . "'");
###
$_SESSION['msg1'] = 'Pomyślnie usunięto voucher o id:' . $id . '!';
$_SESSION['msg-type'] = 'success';
示例8: mysql_query
// HOW OLD CACHE MUST BE BEFORE IT NEEDS REFRESHING
$request = "sep";
// WHAT TO PRE-CACHE: [s] = BASIC INFO [e] = SETTINGS [p] = PLAYERS
//------------------------------------------------------------------------------------------------------------+
$mysql_query = "SELECT `type`,`ip`,`c_port`,`q_port`,`s_port` FROM `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}` WHERE `disabled`=0 ORDER BY `cache_time` ASC";
$mysql_result = mysql_query($mysql_query) or die(mysql_error());
while ($mysql_row = mysql_fetch_array($mysql_result, MYSQL_ASSOC)) {
lgsl_query_cached($mysql_row['type'], $mysql_row['ip'], $mysql_row['c_port'], $mysql_row['q_port'], $mysql_row['s_port'], $request);
}
//------------------------------------------------------------------------------------------------------------+
//------------------------------------------------------------------------------------------------------------+
/**
* BOX MONITORING
*/
$boxData = array();
if (query_numrows("SELECT `boxid` FROM `" . DBPREFIX . "box` ORDER BY `boxid`") != 0) {
$boxes = mysql_query("SELECT `boxid`, `ip`, `login`, `password`, `sshport` FROM `" . DBPREFIX . "box`");
while ($rowsBoxes = mysql_fetch_assoc($boxes)) {
$aes = new Crypt_AES();
$aes->setKeyLength(256);
$aes->setKey(CRYPT_KEY);
$ssh = new Net_SSH2($rowsBoxes['ip'], $rowsBoxes['sshport']);
if (!$ssh->login($rowsBoxes['login'], $aes->decrypt($rowsBoxes['password']))) {
//Connection Error!
$boxCache = array($rowsBoxes['boxid'] => array('players' => array('players' => 0), 'bandwidth' => array('rx_usage' => 0, 'tx_usage' => 0, 'rx_total' => 0, 'tx_total' => 0), 'cpu' => array('proc' => '', 'cores' => 0, 'usage' => 0), 'ram' => array('total' => 0, 'used' => 0, 'free' => 0, 'usage' => 0), 'loadavg' => array('loadavg' => '0.00'), 'hostname' => array('hostname' => ''), 'os' => array('os' => ''), 'date' => array('date' => ''), 'kernel' => array('kernel' => ''), 'arch' => array('arch' => ''), 'uptime' => array('uptime' => ''), 'swap' => array('total' => 0, 'used' => 0, 'free' => 0, 'usage' => 0), 'hdd' => array('total' => 0, 'used' => 0, 'free' => 0, 'usage' => 0)));
query_basic("UPDATE `" . DBPREFIX . "box` SET\n\t\t\t\t`cache` = '" . mysql_real_escape_string(gzcompress(serialize($boxCache), 2)) . "' WHERE `boxid` = '" . $rowsBoxes['boxid'] . "'");
unset($boxCache);
} else {
//------------------------------------------------------------------------------------------------------------+
//We have to clean screenlog.0 files
$servers = mysql_query("SELECT `path` FROM `" . DBPREFIX . "server` WHERE `boxid` = '" . $rowsBoxes['boxid'] . "' && `status` = 'Active'");
示例9: getGroupClients
/**
* Retrieve all Group's clients in a multi- dimensional array
*
* Return FALSE if the GROUPID is invalid OR if the Group doesn't have clients OR if there is no members in the table
*/
function getGroupClients($groupid)
{
if (query_numrows("SELECT `name` FROM `" . DBPREFIX . "group` WHERE `groupid` = '" . $groupid . "'") != 0) {
// The specified group exists
if (query_numrows("SELECT `id` FROM `" . DBPREFIX . "groupMember`") > 0) {
// There is at least one member
$members = mysql_query("SELECT `clientid`, `groupids` FROM `" . DBPREFIX . "groupMember`");
$i = 0;
while ($rowsMembers = mysql_fetch_assoc($members)) {
if (!empty($rowsMembers['clientid'])) {
$groupids = explode(';', $rowsMembers['groupids']);
// CSV
foreach ($groupids as $value) {
if ($value == $groupid) {
$clients[$i] = $rowsMembers['clientid'];
$i++;
break;
}
}
}
}
if (isset($clients)) {
return $clients;
}
}
}
return FALSE;
}
示例10: T_
* @categories Games/Entertainment, Systems Administration
* @package Bright Game Panel
* @author warhawk3407 <warhawk3407@gmail.com> @NOSPAM
* @copyleft 2013
* @license GNU General Public License version 3.0 (GPLv3)
* @version (Release 0) DEVELOPER BETA 8
* @link http://www.bgpanel.net/
*/
$page = 'scriptadd';
$tab = 5;
$return = 'scriptadd.php';
require "../configuration.php";
require "./include.php";
$title = T_('Add New Script');
$numBoxes = query_numrows("SELECT `boxid` FROM `" . DBPREFIX . "box`");
$numCats = query_numrows("SELECT `id` FROM `" . DBPREFIX . "scriptCat`");
//---------------------------------------------------------+
if ($numBoxes == 0) {
$step = 'noboxes';
} else {
if ($numCats == 0) {
$step = 'nocats';
} else {
$step = 'form';
}
}
//---------------------------------------------------------+
include "./bootstrap/header.php";
/**
* Notifications
*/
示例11: notifications
if (query_numrows("SELECT `name` FROM `offerts` WHERE `id` = '" . $id . "'") != 1) {
$error .= 'Taka oferta nie istnieje. ';
}
###
if (!empty($error)) {
notifications($error, 'danger');
unset($error);
header("Location: product.php?id=" . $id . "&payment=" . $payment . "");
die;
}
###
$offert = query_fetch_assoc("SELECT `amount` FROM `offerts` WHERE `id` = '" . $id . "'");
$config = query_fetch_assoc("SELECT * FROM `config`");
$voucher = query_fetch_assoc("SELECT `amount`, `id` FROM `voucher` WHERE `code` = '" . $code . "' LIMIT 1");
###
if (query_numrows("SELECT `amount` FROM `voucher` WHERE `code` = '" . $code . "'") == 1 && $voucher['amount'] != 0) {
$amount = $voucher['amount'] - 1;
###
query_basic("UPDATE `voucher` SET `amount`='" . $amount . "' WHERE `id` = '" . $voucher['id'] . "'");
} else {
notifications('Ten kod jest błędny lub został już wykorzystany!', 'danger');
unset($error);
header("Location: product.php?id=" . $id . "&payment=" . $payment . "");
die;
}
###
define('MQ_SERVER_ADDR', $config['ip']);
define('MQ_SERVER_PORT', $config['port_rcon']);
define('MQ_SERVER_PASS', $config['password_rcon']);
define('MQ_TIMEOUT', 2);
###
示例12: exit
*/
$page = 'configgroupedit';
$tab = 5;
$isSummary = TRUE;
###
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
$groupid = $_GET['id'];
} else {
exit('Error: GroupID error.');
}
###
$return = 'configgroupedit.php?id=' . urlencode($groupid);
require "../configuration.php";
require "./include.php";
$title = T_('Edit Group');
if (query_numrows("SELECT `name` FROM `" . DBPREFIX . "group` WHERE `groupid` = '" . $groupid . "'") == 0) {
exit('Error: GroupID is invalid.');
}
$rows = query_fetch_assoc("SELECT `name`, `description` FROM `" . DBPREFIX . "group` WHERE `groupid` = '" . $groupid . "' LIMIT 1");
$clients = getGroupClients($groupid);
if ($clients == FALSE) {
$error = T_("This group doesn't have clients.");
}
include "./bootstrap/header.php";
/**
* Notifications
*/
include "./bootstrap/notifications.php";
?>
<div class="well">
<form method="post" action="configgroupprocess.php">
示例13: T_
$return = 'serveradd.php';
require "../configuration.php";
require "./include.php";
$title = T_('Add New Server');
$numBoxes = query_numrows("SELECT `boxid` FROM `" . DBPREFIX . "box`");
$numGroups = query_numrows("SELECT `groupid` FROM `" . DBPREFIX . "group`");
$games = mysql_query("SELECT `gameid`, `game` FROM `" . DBPREFIX . "game` WHERE `status` = 'Active' ORDER BY `game`");
//---------------------------------------------------------+
if ($numBoxes == 0) {
$step = 'noboxes';
} else {
if ($numGroups == 0) {
$step = 'nogroups';
} else {
if (isset($_GET['gameid']) && is_numeric($_GET['gameid'])) {
if (query_numrows("SELECT `game` FROM `" . DBPREFIX . "game` WHERE `gameid` = '" . $_GET['gameid'] . "'") == 0) {
exit('Error: Game is invalid.');
} else {
$gameid = $_GET['gameid'];
$step = 'form';
}
} else {
$step = 'selectgame';
}
}
}
//---------------------------------------------------------+
include "./bootstrap/header.php";
/**
* Notifications
*/
示例14: define
define('DBVERSION', $panelVersion['value']);
define('TEMPLATE', $template['value']);
define('MAINTENANCE', $maintenance['value']);
unset($panelName, $panelVersion, $template, $maintenance);
define('PROJECT', $bgpCoreInfo->{'project'});
define('PACKAGE', $bgpCoreInfo->{'package'});
define('BRANCH', $bgpCoreInfo->{'branch'});
define('COREVERSION', $bgpCoreInfo->{'version'});
define('RELEASEDATE', $bgpCoreInfo->{'date'});
unset($bgpCoreInfo);
/**
* CRYPT_KEY is the Passphrase Used to Cipher/Decipher SSH Passwords
* The key is stored into the file: ".ssh/passphrase"
*/
define('CRYPT_KEY', file_get_contents("../.ssh/passphrase"));
/**
* API_KEY is used to access / protect contents
*/
define('API_KEY', substr(CRYPT_KEY, strlen(CRYPT_KEY) / 2));
/**
* MAINTENANCE CHECKER
* Logout user if this one is not a Super Administrator.
*/
if (MAINTENANCE == 1) {
if (isAdminLoggedIn() == TRUE) {
if (query_numrows("SELECT `adminid` FROM `" . DBPREFIX . "admin` WHERE `adminid` = '" . $_SESSION['adminid'] . "' AND `access` = 'Super'") == 0) {
logout();
exit('<h1><b>503 Service Unavailable</b></h1>');
}
}
}
示例15: mysql_real_escape_string
} else {
if (isset($_GET['id'])) {
$id = mysql_real_escape_string($_GET['id']);
}
}
###
if (isset($_POST['payment'])) {
$payment = mysql_real_escape_string($_POST['payment']);
} else {
if (isset($_GET['payment'])) {
$payment = mysql_real_escape_string($_GET['payment']);
}
}
//----------------------------------------------------+
if (!empty($id) && !empty($payment)) {
if (query_numrows("SELECT `name` FROM `offerts` WHERE `id` = '" . $id . "'") == 1) {
$offerts = query_fetch_assoc("SELECT * FROM `offerts` WHERE `id` = '" . $id . "' LIMIT 150");
$sms = query_fetch_assoc("SELECT `csms`, `nsms`, `asms` FROM `sms` WHERE `id` = '" . $offerts['amount'] . "' LIMIT 1");
?>
<p style="font-size: 25px">Wybrałeś Ofertę: <b><?php
echo $offerts['name'];
?>
</b>, jej koszt wynosi <b><?php
echo $sms['asms'];
?>
</b> zł.</p>
</hr>
<?php
if ($payment == 'sms') {
echo "<p>Wyślij smsa o treści: <b>" . $sms['csms'] . "</b> na numer: <b>" . $sms['nsms'] . "</b>.</p>";
}