本文整理汇总了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;
}
}
}
示例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;