本文整理汇总了PHP中dbex::query方法的典型用法代码示例。如果您正苦于以下问题:PHP dbex::query方法的具体用法?PHP dbex::query怎么用?PHP dbex::query使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dbex
的用法示例。
在下文中一共展示了dbex::query方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runquery
</div>
<strong>Powered by iweb_sns V1.0 © 2010 </strong>
<br /><br />
<?php
if ($step == '3' && $creatable) {
runquery(openfile($installSQL), $tablePreStr);
?>
<script type="text/javascript">showMsg('');showMsg('共创建了<?php
echo $tablenum;
?>
个数据表.');</script>
<script type="text/javascript">$('createTables').disabled = '';$('createTables').value = '完 成';$('createTables').style.color = '#4e4e4e';$('createTables').style.cursor = 'pointer';</script>
<?php
$sql = "INSERT INTO isns_admin(`admin_name`,`admin_password`,`admin_group`,`active_time`,`is_pass`) VALUES('{$admin}','" . md5($password) . "','superadmin',NOW(),1)";
$sql = str_replace('isns_', $tablePreStr, $sql);
if (!$db->query($sql)) {
echo '创建后台管理员失败!';
exit;
}
}
?>
</body>
</html>
<?php
function runquery($sql, $tablePreStr)
{
global $db, $tablenum;
$sql = str_replace("\r", "\n", str_replace('isns_', $tablePreStr, $sql));
$ret = array();
$num = 0;
foreach (explode(";\n", trim($sql)) as $query) {
示例2: dbex
include_once $dbConfFile;
include_once $webRoot . 'foundation/debug.php';
$c = new SaeTClientV2(WB_AKEY, WB_SKEY, $_SESSION['stoken']);
$dbo = new dbex($dbServs);
/* 获取关注任务的图标url */
$sql = "select task_id, task_sina_uid from task where type='follow' and (task_icon_url IS NULL OR task_screen_name IS NULL OR task_location IS NULL) limit 2";
$sql_res = $dbo->getRs($sql);
foreach ($sql_res as $user) {
$user_info = $c->show_user_by_id($user['task_sina_uid']);
if_weiboapi_fail($user_info);
$icon_url = $user_info['avatar_large'];
$screen_name = $user_info['screen_name'];
$location = $user_info['location'];
// echo '<p><img src="'.$icon_url.'" />'.$location.$screen_name.'</p>';
$sql = "update task set task_icon_url='{$icon_url}', task_screen_name='{$screen_name}', task_location='{$location}' where task_id = {$user['task_id']} limit 1";
echo '<p>' . $sql . '</p>';
$dbo->query($sql);
}
/* 获取转发任务的小图标,微博内容,微博图片大url和小url */
$sql = "select task_id, task_sina_wid from task where type='repost' and (task_icon_url IS NULL OR task_thumbnail_pic_url IS NULL OR task_bmiddle_pic_url IS NULL OR task_text IS NULL) limit 50";
$sql_res = $dbo->getRs($sql);
foreach ($sql_res as $user) {
$weibo = $c->show_status($user['task_sina_wid']);
if_weiboapi_fail($weibo);
$task_icon_url = $weibo['user']['profile_image_url'];
$task_thumbnail_pic_url = $weibo['thumbnail_pic_url'];
$task_bmiddle_pic_url = $weibo['bmiddle_pic_url'];
$task_text = $weibo['text'];
echo '<img src="' . $task_icon_url . '">' . "<p>{$task_text}</p>" . '<a href="' . $task_bmiddle_pic_url . '"><img src="' . $task_thumbnail_pic_url . '"></a>';
}
$dbo->close();
示例3: trim
// 尚未登录,进行登录
if (isset($_POST['submitted']) && isset($_POST['email']) && isset($_POST['pass'])) {
$e = trim($_POST['email']);
$p = trim($_POST['pass']);
if (check_email_fail($e) || check_password_fail($p)) {
// 邮箱或密码格式不对
header('Location:' . $siteRoot . 'index.php?login_error=wrong_format');
exit;
}
include_once $webRoot . "lib/dbo.class.php";
include_once $dbConfFile;
$dbo = new dbex($dbServs);
$e = $dbo->real_escape_string($e);
$ency_p = md5($p);
$sql = "select user_id, nick_name, role, level, realtime_money from user where email = '{$e}' and pass = sha1('{$ency_p}') limit 1";
$res = $dbo->query($sql);
if (1 != $res->num_rows) {
// 邮箱与密码不匹配
header('Location:' . $siteRoot . 'index.php?login_error=mismatch');
exit;
}
// 登录成功
$row = $res->fetch_array();
$_SESSION['uid'] = $row['user_id'];
$_SESSION['name'] = $row['nick_name'];
$_SESSION['role'] = user_role_switch($row['role'], false);
// from num to string
$_SESSION['level'] = $row['level'];
$_SESSION['user_realtime_money'] = price_db_to_user($row['realtime_money']);
$sql = "select sina_uid, sina_level, sina_token from user_info_sina where user_id = '{$_SESSION['uid']}' limit 1";
$row = $dbo->getRow($sql);