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


PHP CONNECT_DB函數代碼示例

本文整理匯總了PHP中CONNECT_DB函數的典型用法代碼示例。如果您正苦於以下問題:PHP CONNECT_DB函數的具體用法?PHP CONNECT_DB怎麽用?PHP CONNECT_DB使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了CONNECT_DB函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: CHECK_USER

function CHECK_USER($table, $user, $pass)
{
    CONNECT_DB();
    $qry = "SELECT * FROM {$table} WHERE login='{$user}' AND passwd='" . md5($pass) . "'";
    $result = mysql_query($qry);
    //Check whether the query was successful or not
    if ($result) {
        if (mysql_num_rows($result) == 1) {
            return true;
        } else {
            return false;
        }
    }
}
開發者ID:hoangquocdong,項目名稱:mmmmdmdmsdd,代碼行數:14,代碼來源:db_functions.php

示例2: isset

require "libs/common_functions.php";
$month = isset($_REQUEST['month']) ? $_REQUEST['month'] : '';
$serial = isset($_REQUEST['serial']) ? $_REQUEST['serial'] : '';
$serial = clean_text($serial);
$month = clean_text($month);
/*
* chưa có token
*/
$tmp = $month . '-01';
$et = strtotime($tmp) - 300;
$datestring = $tmp . ' first day of last month';
$dt = date_create($datestring);
$st = $dt->format('Y-m-d');
$st = strtotime($st) - 300;
$data = array();
CONNECT_DB();
mysql_query("SET NAMES utf8");
function getdecimalnumber($unitmeter, $number, $decimalcount)
{
    if ($unitmeter == 1) {
        $number = $number / 1000;
    }
    $pointer = 1;
    for ($i = 1; $i <= $decimalcount; $i++) {
        $pointer = $pointer * 10;
    }
    $result = floor($number * $pointer) / $pointer;
    $result = number_format($result, $decimalcount, ",", ".");
    return $result;
}
$unitmeter = 0;
開發者ID:hoangquocdong,項目名稱:mmmmdmdmsdd,代碼行數:31,代碼來源:chotchisothang+copy.php


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