當前位置: 首頁>>代碼示例>>PHP>>正文


PHP dbex::query方法代碼示例

本文整理匯總了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 &copy; 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) {
開發者ID:omusico,項目名稱:Social,代碼行數:31,代碼來源:index.php

示例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();
開發者ID:mafergomez70,項目名稱:micro-power,代碼行數:31,代碼來源:get_task_data.php

示例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);
開發者ID:mafergomez70,項目名稱:micro-power,代碼行數:31,代碼來源:v_login.php


注:本文中的dbex::query方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。