本文整理汇总了PHP中dbstuff::result方法的典型用法代码示例。如果您正苦于以下问题:PHP dbstuff::result方法的具体用法?PHP dbstuff::result怎么用?PHP dbstuff::result使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dbstuff
的用法示例。
在下文中一共展示了dbstuff::result方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getImCount
function getImCount()
{
$db_uch = new dbstuff();
$db_uch->charset = dbcharset;
$db_uch->connect(dbhost, dbuser, dbpw, dbname, pconnect);
$result = $db_uch->result($db_uch->query("SELECT COUNT(*) FROM " . tname("spacefield") . " WHERE qq <> ''"), 0);
return $result;
}
示例2: isset
'3' => '按月份存入不同目录',
'4' => '按天存入不同目录',
);
if(!empty($_POST['moveattsubmit']) || $step == 1) {
$rpp = "500"; //每次处理多少条数据
$totalrows = isset($totalrows) ? $totalrows : 0;
$convertedrows = isset($convertedrows) ? $convertedrows : 0;
$start = isset($start) && $start > 0 ? $start : 0;
$end = $start + $rpp - 1;
$converted = 0;
$maxid = isset($maxid) ? $maxid : 0;
$newattachsave = isset($newattachsave) ? $newattachsave : 0;
$step = 1;
if($start <= 1) {
$db->query("UPDATE {$tablepre}settings SET value = '$newattachsave' WHERE variable = 'attachsave'");
$cattachdir = $db->result($db->query("SELECT value FROM {$tablepre}settings WHERE variable = 'attachdir'"), 0);
validid('aid', 'attachments');
}
$attachpath = isset($cattachdir) ? TOOLS_ROOT.$cattachdir : TOOLS_ROOT.'./attachments';
$query = $db->query("SELECT aid, tid, dateline, filename, filetype, attachment, isimage, thumb FROM {$tablepre}attachments WHERE aid >= $start AND aid <= $end");
while ($a = $db->fetch_array($query)) {
$aid = $a['aid'];
$tid = $a['tid'];
$dateline = $a['dateline'];
$filename = $a['filename'];
$filetype = $a['filetype'];
$attachment = $a['attachment'];
$isimage = $a['isimage'];
$thumb = $a['thumb'];
$oldpath = $attachpath.'/'.$attachment;
if(file_exists($oldpath)) {
示例3: loginit
loginit($yearmonth . 'illegallog');
loginit($yearmonth . 'modslog');
loginit($yearmonth . 'cplog');
loginit($yearmonth . 'errorlog');
loginit($yearmonth . 'banlog');
dir_clear(ROOT_PATH . './data/template');
dir_clear(ROOT_PATH . './data/cache');
dir_clear(ROOT_PATH . './data/threadcache');
dir_clear(ROOT_PATH . './uc_client/data');
dir_clear(ROOT_PATH . './uc_client/data/cache');
foreach ($serialize_sql_setting as $k => $v) {
$v = addslashes(serialize($v));
$db->query("REPLACE INTO {$tablepre}common_setting VALUES ('{$k}', '{$v}')");
}
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}common_member");
$totalmembers = $db->result($query, 0);
$userstats = array('totalmembers' => $totalmembers, 'newsetuser' => $username);
$ctype = 1;
$data = addslashes(serialize($userstats));
$db->query("REPLACE INTO {$tablepre}common_syscache (cname, ctype, dateline, data) VALUES ('userstats', '{$ctype}', '" . time() . "', '{$data}')");
touch($lockfile);
VIEW_OFF && show_msg('initdbresult_succ');
if (!VIEW_OFF) {
echo '<script type="text/javascript">function setlaststep() {document.getElementById("laststep").disabled=false;window.location=\'index.php?method=ext_info\';}</script><script type="text/javascript">setTimeout(function(){window.location=\'index.php?method=ext_info\'}, 30000);</script><iframe src="../misc.php?mod=initsys" style="display:none;" onload="setlaststep()"></iframe>' . "\r\n";
show_footer();
}
}
if (VIEW_OFF) {
show_msg('missing_parameter', '', 0);
} else {
show_form($form_db_init_items, $error_msg);
示例4: VERSION
$curr_os = PHP_OS;
$curr_php_version = PHP_VERSION;
if ($curr_php_version < '4.3.0') {
$msg .= "<font color=\"#FF0000\">{$lang['php_version_430']}</font>\t";
$quit = TRUE;
}
if (@ini_get(file_uploads)) {
$max_size = @ini_get(upload_max_filesize);
$curr_upload_status = $lang['attach_enabled'] . $max_size;
$msg .= $lang['attach_enabled_info'] . $max_size . "\t";
} else {
$curr_upload_status = $lang['attach_disabled'];
$msg .= "<font color=\"#FF0000\">{$lang['attach_disabled_info']}</font>\t";
}
$query = $db->query("SELECT VERSION()");
$curr_mysql_version = $db->result($query, 0);
if ($curr_mysql_version < '3.23') {
$msg .= "<font color=\"#FF0000\">{$lang['mysql_version_323']}</font>\t";
$quit = TRUE;
}
$curr_disk_space = intval(diskfreespace('.') / (1024 * 1024)) . 'M';
if (dir_writeable('./templates')) {
$curr_tpl_writeable = $lang['writeable'];
} else {
$curr_tpl_writeable = $lang['unwriteable'];
$msg .= "<font color=\"#FF0000\">{$lang['unwriteable_template']}</font>\t";
}
if (dir_writeable('./gamedata')) {
$curr_data_writeable = $lang['writeable'];
} else {
$curr_data_writeable = $lang['unwriteable'];
示例5: foreach
}
$db->query("UPDATE {$tablepre}members SET {$sql} WHERE uid='{$member['uid']}'");
$sql = $comma = '';
foreach ($table_memberfields_columns as $field) {
if (isset($memberfields[$field])) {
$sql .= "{$comma}{$field}='{$memberfields[$field]}'";
$comma = ', ';
}
}
if ($sql) {
$db->query("UPDATE {$tablepre}memberfields SET {$sql} WHERE uid='{$member['uid']}'");
}
} else {
if (empty($memberfields['groupid'])) {
$query = $db->query("SELECT groupid FROM {$tablepre}usergroups WHERE type='member' AND creditshigher='0'");
$memberfields['groupid'] = $db->result($query, 0);
$memberfields['adminid'] = 0;
}
$memberfields['timeoffset'] = !$memberfields['timeoffset'] ? 9999 : $memberfields['timeoffset'];
$memberfields['newsletter'] = !$memberfields['newsletter'] ? 1 : $memberfields['newsletter'];
$sql1 = $sql2 = $comma = '';
foreach ($table_member_columns as $field) {
if (isset($memberfields[$field])) {
$sql1 .= "{$comma}{$field}";
$sql2 .= "{$comma}'{$memberfields[$field]}'";
$comma = ', ';
}
}
$db->query("INSERT INTO {$tablepre}members ({$sql1}) VALUES ({$sql2})");
$table_memberfields_columns[] = 'uid';
$memberfields['uid'] = $member['uid'] = $db->insert_id();
示例6: substr
$Id: advcache.php 16698 2008-11-14 07:58:56Z cnteacher $
*/
error_reporting(0);
define('IN_DISCUZ', TRUE);
define('DISCUZ_ROOT', substr(dirname(__FILE__), 0, -3));
$timestamp = time();
@set_time_limit(1000);
@ignore_user_abort(TRUE);
require_once DISCUZ_ROOT . './config.inc.php';
require_once DISCUZ_ROOT . './include/db_' . $database . '.class.php';
require_once DISCUZ_ROOT . './include/insenz.func.php';
$db = new dbstuff();
$db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect, true, $dbcharset);
unset($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
$query = $db->query("SELECT value FROM {$tablepre}settings WHERE variable='insenz'");
$insenz = ($insenz = $db->result($query, 0)) ? unserialize($insenz) : array();
$insenz['host'] = empty($insenz['host']) ? 'api.insenz.com' : $insenz['host'];
$insenz['url'] = empty($insenz['url']) ? 'api.insenz.com' : $insenz['url'];
$insenz['siteid'] = intval($insenz['siteid']);
if (empty($insenz['authkey'])) {
exit;
}
$type = intval($_GET['type']);
$cid = intval($_GET['cid']);
if (empty($type)) {
if (empty($insenz['hardadstatus']) || !empty($insenz['lastupdated']) && $timestamp - $insenz['lastupdated'] < 600) {
exit;
}
$response = insenz_request('adv.php', '<cmd id="getSiteAdJs"><site_id>' . $insenz['siteid'] . '</site_id></cmd>');
$hash = $response[0]['hash'][0]['VALUE'];
$updateadvcache = FALSE;
示例7: htmlspecialchars
}
$return = htmlspecialchars($return);
}
if (!$tid) {
$inajax = 1;
include template('relatekw');
} else {
if ($_DCACHE['settings']['tagstatus'] && $kws) {
require_once DISCUZ_ROOT . '/forumdata/cache/cache_censor.php';
$tagcount = 0;
foreach ($kws as $tagname) {
$tagname = trim(empty($_DCACHE['censor']['filter']) ? $tagname : preg_replace($_DCACHE['censor']['filter']['find'], $_DCACHE['censor']['filter']['replace'], $tagname));
if (preg_match('/^([\\x7f-\\xff_-]|\\w|\\s){3,20}$/', $tagname)) {
$query = $db->query("SELECT closed FROM {$tablepre}tags WHERE tagname='{$tagname}'");
if ($db->num_rows($query)) {
if (!($tagstatus = $db->result($query, 0))) {
$db->query("UPDATE {$tablepre}tags SET total=total+1 WHERE tagname='{$tagname}'", 'UNBUFFERED');
}
} else {
$db->query("INSERT INTO {$tablepre}tags (tagname, closed, total)\r\n\t\t\t\t\t\t\tVALUES ('{$tagname}', 0, 1)", 'UNBUFFERED');
$tagstatus = 0;
}
if (!$tagstatus) {
$db->query("INSERT {$tablepre}threadtags (tagname, tid) VALUES ('{$tagname}', {$tid})", 'UNBUFFERED');
}
$tagcount++;
if ($tagcount > 4) {
break;
}
}
}
示例8: formhash
if ($adminid == 3) {
$modadd1 = ', m.uid AS ismoderator';
$modadd2 = "LEFT JOIN {$tablepre}moderators m ON m.uid='{$discuz_uid}' AND m.fid=f.fid";
}
}
if ($errorreport == 2 || $errorreport == 1 && $adminid > 0) {
error_reporting(E_ERROR | E_WARNING | E_PARSE);
}
define('FORMHASH', formhash());
$statstatus && !$inajax && (require_once DISCUZ_ROOT . './include/counter.inc.php');
$extra = isset($extra) && @preg_match("/^[&=;a-z0-9]+\$/i", $extra) ? $extra : '';
$rsshead = $navtitle = $navigation = '';
$_DSESSION['groupid'] = $groupid = empty($ipbanned) ? empty($groupid) ? 7 : intval($groupid) : 6;
if (!@(include DISCUZ_ROOT . './forumdata/cache/usergroup_' . $groupid . '.php')) {
$query = $db->query("SELECT type FROM {$tablepre}usergroups WHERE groupid='{$groupid}'");
$grouptype = $db->result($query, 0);
if (!empty($grouptype)) {
$cachelost .= ' usergroup_' . $groupid;
} else {
$grouptype = 'member';
}
}
if ($passport_status && ($passport_status != 'shopex' || !$passport_shopex)) {
$passport_forward = rawurlencode('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
$link_login = $passport_url . $passport_login_url . (strpos($passport_login_url, '?') === FALSE ? '?' : '&') . 'forward=' . $passport_forward;
$link_logout = $passport_url . $passport_logout_url . (strpos($passport_logout_url, '?') === FALSE ? '?' : '&') . 'forward=' . $passport_forward;
$link_register = $passport_url . $passport_register_url . (strpos($passport_register_url, '?') === FALSE ? '?' : '&') . 'forward=' . $passport_forward;
} else {
$link_login = 'logging.php?action=login';
$link_logout = 'logging.php?action=logout&formhash=' . FORMHASH;
$link_register = $regname;