当前位置: 首页>>代码示例>>PHP>>正文


PHP dbclose函数代码示例

本文整理汇总了PHP中dbclose函数的典型用法代码示例。如果您正苦于以下问题:PHP dbclose函数的具体用法?PHP dbclose怎么用?PHP dbclose使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dbclose函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: login

function login($id, $passwd, $url)
{
    $dbh = dbconnect();
    $query = "select mem_id,mem_pw from member_data where mem_id='{$id}'";
    $sth = dbquery($dbh, $query);
    if (!$sth) {
        print_msg(mysql_error());
    }
    list($mem_id, $mem_pw) = dbselect($sth);
    dbclose($dbh);
    if (!$mem_id) {
        print_alert("해당 ID가 없습니다.  ", 'back');
    } elseif ($mem_pw != $passwd) {
        print_alert("비밀번호가 틀립니다.  ", 'back');
    } else {
        setcookie("MemberID", $mem_id);
        header("Location: {$url}");
    }
    return;
}
开发者ID:puchon,项目名称:php4-book,代码行数:20,代码来源:login.php

示例2: check_idnum

function check_idnum($idnum)
{
    if (!check_idnum_syntax($idnum)) {
        print_msg("주민등록가 잘못되었습니다.<br>정확히 입력하세요.", 'check_idnum', -1);
    }
    $dbh = dbconnect();
    $idnum2 = substr($idnum, 0, 6) . "-" . substr($idnum, 6, 7);
    $query = "select mem_idnum from member_data where mem_idnum='{$idnum2}'";
    $sth = dbquery($dbh, $query);
    if (!$sth) {
        print_msg(mysql_error());
    }
    list($mem_idnum) = dbselect($sth);
    dbclose($dbh);
    if ($mem_idnum == $idnum2) {
        return false;
    } else {
        return true;
    }
}
开发者ID:puchon,项目名称:php4-book,代码行数:20,代码来源:mem-lib.php

示例3: check_passwd

function check_passwd($db, $idx, $rn, $passwd)
{
    /* 데이타 확인 */
    $dbh = dbconnect();
    $table_name = "bbs_" . $db;
    $query = "select idx,replynum,passwd from {$table_name} where idx={$idx} and replynum={$rn}";
    $sth = dbquery($dbh, $query);
    if (!$sth) {
        print_message(mysql_error());
    }
    list($c_idx, $c_replynum, $c_passwd) = dbselect($sth);
    dbclose($dbh);
    /* 존재하지 않을때 */
    if (!$c_idx) {
        return -1;
    }
    /* 비밀번호 확인 */
    if ($passwd == $admin_passwd || $passwd == $c_passwd) {
        return 1;
    }
    return 0;
}
开发者ID:puchon,项目名称:php4-book,代码行数:22,代码来源:bbs-lib.php

示例4: number_format

}
// HTML code to display the graph
echo "<TABLE BORDER=\"0\" CELLPADDING=\"10\" CELLSPACING=\"0\" WIDTH=\"100%\">";
echo "<TR>";
echo " <TD ALIGN=\"CENTER\"><IMG SRC=\"" . IMAGES_DIR . "mailscannerlogo.gif\" ALT=\"MailScannr Logo\"></TD>";
echo "</TR>";
echo "<TR>";
//  Check Permissions to see if the file has been written and that apache to read it.
if (is_readable($filename)) {
    echo " <TD ALIGN=\"CENTER\"><IMG SRC=\"" . $filename . "\" ALT=\"Graph\"></TD>";
} else {
    echo "<TD ALIGN=\"CENTER\"> File isn't readable. Please make sure that " . CACHE_DIR . " is readable and writable by MailWatch.";
}
echo "</TR>";
echo "<TR>";
echo "<TD ALIGN=\"CENTER\">";
echo "<TABLE WIDTH=\"500\">";
echo "<TR BGCOLOR=\"#F7CE4A\">";
echo "<TH>Domain</TH>";
echo "<TH>Count</TH>";
echo "<TH>Size</TH>";
echo "</TR>";
for ($i = 0; $i < count($data); $i++) {
    echo "<TR BGCOLOR=\"#EBEBEB\">\n <TD>{$data_names[$i]}</TD>\n <TD ALIGN=\"RIGHT\">" . number_format($data[$i]) . "</TD>\n <TD ALIGN=\"RIGHT\">" . format_mail_size($data_size[$i]) . "</TD>\n</TR>\n";
}
echo "\n  </TABLE>\n </TD>\n</TR>\n</TABLE>";
// Add footer
html_end();
// Close any open db connections
dbclose();
开发者ID:rafaelbsd,项目名称:1.2.0,代码行数:30,代码来源:rep_top_sender_domains_by_volume.php

示例5: retGUI

function retGUI() {
	global $CMD;
	global $OUTJSON;
	global $DBH;
	global $STDIN;
	global $APPL;
	global $ini;
	if (!isset($OUTJSON['cmd'])) $OUTJSON['cmd']=array();
	
	endWin();
	
	if (count($CMD)) {
		foreach($CMD as $a) $OUTJSON['cmd'][]= $a;
		}
			
	header("Content-Type: application/json; charset=UTF-8",true);
	header("X-Sid: ".session_id());
	fclose($STDIN);
	if (isset($ini['db']))dbclose($DBH);
	
	exit(json_encode($OUTJSON));
	}
开发者ID:epto,项目名称:webgui8,代码行数:22,代码来源:webgui.php

示例6: print_alert

    print_alert("DB를 지정하셔야 합니다.", 'back');
    exit;
}
if (!$m) {
    $m = 'list';
}
/* Table 이름 지정 */
$table_name = "bbs_" . $db;
if (!$pn) {
    $pn = 1;
}
/* DB접속 */
$dbh = dbconnect();
$from_string = "from=list";
$start_num = ($pn - 1) * $max_list;
$end_num = $pn * $max_list;
/* 전체 글수 */
$query = "select count(idx) from {$table_name}";
$sth = dbquery($dbh, $query);
list($total_count) = dbselect($sth);
/* 데이터 $max_list 만큼 뽑아서 @LIST_DATA 에 저장. */
$query = "select {$column} from {$table_name} order by idx desc,replynum limit {$start_num},{$max_list}";
$sth = dbquery($dbh, $query);
$i = 0;
$LIST_DATA = array();
while ($field = dbselect($sth)) {
    array_push($LIST_DATA, "{$field['0']}|{$field['1']}|{$field['2']}|\n\t\t{$field['3']}|{$field['4']}|{$field['5']}|{$field['6']}|{$field['7']}");
    $i++;
}
dbclose($dbh);
include "show_list.php";
开发者ID:puchon,项目名称:php4-book,代码行数:31,代码来源:list.php

示例7: header

				
		WGSession();
		
		$startFile=WGHTTPRedirection();
		if ($lockIntUri) {
			header("Location: /",true);
			exit("Access denied by HTTP policy.");
			}
	}
	
if (!$lockIntUri or isset($ini['logon'])) $_SESSION=array();

header("Content-Type: text/html; charset=UTF-8",true,200);

EWGCacheFont();
if ($DBH) dbclose($DBH);

?><!doctype html>
<html>
	<head>
		<meta charset="utf-8"/>
		<title><?php 
echo htmlspecialchars(@$ini['webgui']['title'], ENT_QUOTES);
?>
</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<?
	if (@$ini['webgui']['cookie']) echo "<script src=\"/sys/cookie.js\"></script>\n";
	?>
	<link rel="stylesheet" href="/sys/win.css">
	<? 
开发者ID:epto,项目名称:webgui8,代码行数:30,代码来源:index.php

示例8: dbclose

        echo $row["groupid"];
        ?>
</td><td><?php 
        echo $row["groupname"];
        ?>
</td><td><?php 
        echo $row["content"];
        ?>
</td><td><?php 
        echo $row["timewhen"];
        ?>
</td></tr>		
<?php 
        //$i++;
    }
    ?>
	
<tr><td colspan=7>Total: <?php 
    echo $number_of_queries;
    ?>
 records.</td></tr>
<?php 
} else {
    echo "0 results";
}
?>
</table>
</center>
<?php 
dbclose($con);
开发者ID:Rocket-Fish,项目名称:sms-social-network,代码行数:30,代码来源:groupqueries.php

示例9: dbcreate

}
$word = '';
$phonetic = '';
$definitions = '';
$n = 0;
$db = dbcreate('./ev.db');
$fp = fopen('ev.src', 'r');
while ($s = fgets($fp)) {
    if (preg_match('|^@([^/]+)(/([^/]+)/)?|', $s, $m)) {
        if ($word != '') {
            if (strpos($word, '00-database-') === 0) {
                // TODO:
                // Database info
            } else {
                $n++;
                dbsave($db, $word, $phonetic, $definitions);
                echo "Count = {$n}\r";
            }
            $definitions = '';
        }
        list($sw, $word, $sp, $phonetic) = $m;
    } else {
        $definitions .= $s;
    }
}
if ($word != '') {
    dbsave($db, $word, $phonetic, $definitions);
}
fclose($fp);
dbclose($db);
开发者ID:n2i,项目名称:xvnkb,代码行数:30,代码来源:createdict.php

示例10: while

    while ($row = mysqli_fetch_assoc($res)) {
        $mood = new Weekly();
        $mood->date = $row['iter'];
        $mood->val = getMood($row['mood'], $row['count']);
        $moods[] = $mood;
    }
    /*  $moods=array();
      $i=0;
      for($i=0; $i<3; $i++)
      {
        $mood = new Weekly();
        $mood->date = $i;
        $mood->val = $i*20;
        $moods[] = $mood;
      }
    */
    echo json_encode($moods);
}
switch ($type) {
    case "day":
        dayAnalysis();
        break;
    case "hourly":
        hourlyAnalysis();
        break;
    case "week":
        weekAnalysis();
        break;
}
dbclose($conn);
开发者ID:sakshisharma84,项目名称:Emotisense,代码行数:30,代码来源:analysis.php

示例11: doit

function doit($input)
{
    global $fp;
    if (!($fp = popen($input, 'r'))) {
        die("Cannot open pipe");
    }
    dbconn();
    $lines = 1;
    while ($line = fgets($fp, 2096)) {
        // Reset variables
        unset($parsed, $postfix, $_timestamp, $_host, $_type, $_msg_id, $_relay, $_dsn, $_status, $_delay);
        $parsed = new syslog_parser($line);
        $_timestamp = mysql_real_escape_string($parsed->timestamp);
        $_host = mysql_real_escape_string($parsed->host);
        // Postfix
        if ($parsed->process == 'postfix/smtp' && class_exists('postfix_parser')) {
            $postfix = new postfix_parser($parsed->entry);
            if (DEBUG) {
                print_r($postfix);
            }
            $_msg_id = mysql_real_escape_string($postfix->id);
            // Milter-ahead rejections
            if (preg_match('/Milter: /i', $postfix->raw) && preg_match('/(rejected recipient|user unknown)/i', $postfix->entries['reject'])) {
                $_type = mysql_real_escape_string('unknown_user');
                $_status = mysql_real_escape_string(get_email($postfix->entries['to']));
            }
            // Unknown users
            if (preg_match('/user unknown/i', $postfix->entry)) {
                // Unknown users
                $_type = mysql_real_escape_string('unknown_user');
                $_status = mysql_real_escape_string($postfix->raw);
            }
            // you can use these matches to populate your table with all the various reject reasons etc., so one could get stats about MTA rejects as well
            // example
            if (preg_match('/NOQUEUE/i', $postfix->entry)) {
                if (preg_match('/Client host rejected: cannot find your hostname/i', $postfix->entry)) {
                    $_type = mysql_real_escape_string('unknown_hostname');
                } else {
                    $_type = mysql_real_escape_string('NOQUEUE');
                }
                $_status = mysql_real_escape_string($postfix->raw);
            }
            // Relay lines
            if (isset($postfix->entries['relay']) && isset($postfix->entries['status'])) {
                $_type = mysql_real_escape_string('relay');
                $_delay = mysql_real_escape_string($postfix->entries['delay']);
                $_relay = mysql_real_escape_string(get_ip($postfix->entries['relay']));
                $_dsn = mysql_real_escape_string($postfix->entries['dsn']);
                $_status = mysql_real_escape_string($postfix->entries['status']);
            }
        }
        if (isset($_type)) {
            dbquery("REPLACE INTO mtalog VALUES (FROM_UNIXTIME('{$_timestamp}'),'{$_host}','{$_type}','{$_msg_id}','{$_relay}','{$_dsn}','{$_status}','{$_delay}')");
        }
        $lines++;
    }
    dbclose();
    pclose($fp);
}
开发者ID:thctlo,项目名称:1.2.0,代码行数:59,代码来源:postfix_relay.php

示例12: dbtest

function dbtest()
{
    if ($dbc = @mysql_connect(DB_HOST, DB_USER, DB_PASSWORD)) {
        if (!mysql_select_db(DB_NAME)) {
            $error_str = "Error: Could not select database: " . dberror();
        } else {
            dbclose($dbc);
            return true;
        }
    } else {
        $error_str = "Error: Could not connect to database: " . dberror();
    }
    return false;
}
开发者ID:jrising,项目名称:console,代码行数:14,代码来源:dbfuncs.php

示例13: set_start

function set_start($idx)
{
    global $URL, $pn;
    $dbh = dbconnect();
    $query = "select poll_idx,status from poll_data where poll_idx={$idx}";
    $sth = dbquery($dbh, $query);
    list($poll_idx, $edate) = dbselect($sth);
    if (!$poll_idx) {
        print_alert("존재하지 않는 데이터입니다.   ", 'back');
        exit;
    } elseif ($status == 1) {
        print_alert("현재 설문중입니다.   ", 'back');
        exit;
    }
    /* 설문 재개 */
    $query = "update poll_data set status='1' where poll_idx={$idx}";
    $sth = dbquery($dbh, $query);
    if (!$sth) {
        $msg = "에러가 발생하였습니다.<br><br>\n" . mysql_error();
        print_message($msg);
    } else {
        header("Location: {$URL['list']}?pn={$pn}");
        exit;
    }
    dbclose($dbh);
    exit;
}
开发者ID:puchon,项目名称:php4-book,代码行数:27,代码来源:modify.php


注:本文中的dbclose函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。