本文整理汇总了PHP中mysql_close函数的典型用法代码示例。如果您正苦于以下问题:PHP mysql_close函数的具体用法?PHP mysql_close怎么用?PHP mysql_close使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mysql_close函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: close
public function close()
{
if ($this->opened) {
$this->opened = false;
@mysql_close($this->conn);
}
}
示例2: disconnect
function disconnect()
{
if (!empty($this->db)) {
mysql_close($this->db);
$this->db = null;
}
}
示例3: getTangentText
function getTangentText($type, $keyword)
{
global $dbHost, $dbUser, $dbPassword, $dbName;
$link = @mysql_connect($dbHost, $dbUser, $dbPassword);
if (!$link) {
die("Cannot connect : " . mysql_error());
}
if (!@mysql_select_db($dbName, $link)) {
die("Cannot find database : " . mysql_error());
}
$result = mysql_query("SELECT sr_keywords, sr_text FROM soRandom WHERE sr_type = '" . $type . "' ORDER BY sr_ID ASC;", $link);
$tempCounter = 0;
while ($row = mysql_fetch_assoc($result)) {
$pKey = "/" . $keyword . "/";
$pos = preg_match($pKey, $row['sr_keywords']);
//echo $pos . " is pos<br>";
//echo $keyword;
//echo " is keyword and this is the search return: " . $row['keywords'];
if ($pos != 0) {
$text[$tempCounter] = stripslashes($row["sr_text"]);
$tempCounter++;
}
}
mysql_close($link);
//$text=htmlentities($text);
return $text;
}
示例4: getInsert
function getInsert($param, $name, $score)
{
$dbParams = get_object_vars($param);
$mysql_host = $dbParams['mysql_host'];
$mysql_user = $dbParams['mysql_user'];
$mysql_pass = $dbParams['mysql_pass'];
$dbName = $dbParams['dbName'];
$dbTable = $dbParams['dbTable'];
//connect
$link = mysql_connect($mysql_host, $mysql_user, $mysql_pass) or die('connection error: ' . mysql_error());
//select db
mysql_select_db($dbName) or die('DB error');
//check user highest score
$query_check_user = 'SELECT score FROM ' . $dbTable . ' WHERE name = ' . $name . ';';
$result_check_user = mysql_query($query_check_user) or die('Request down: ' . mysql_error());
$checkUser = mysql_fetch_array($result_check_user);
if ($checkUser['score'] < $score) {
//inserting new scores
$query_insert = 'INSERT INTO ' . $dbTable . '(name,score) VALUES (' . $name . ',' . $score . ') ON DUPLICATE KEY UPDATE score = VALUES(score);';
$result = mysql_query($query_insert) or die('Request insert down: ' . mysql_error());
}
return $result;
// clean
if (isset($result)) {
mysql_free_result($result);
}
// close
mysql_close($link);
}
示例5: HackingLog
function HackingLog()
{
echo "You're not allowed to use this program! This attempted violation has been logged and your IP address was captured.";
Warehouse('footer');
if ($_SERVER['HTTP_X_FORWARDED_FOR']) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
if ($openSISNotifyAddress) {
mail($openSISNotifyAddress, 'HACKING ATTEMPT', "INSERT INTO HACKING_LOG (HOST_NAME,IP_ADDRESS,LOGIN_DATE,VERSION,PHP_SELF,DOCUMENT_ROOT,SCRIPT_NAME,MODNAME,USERNAME) values('{$_SERVER['SERVER_NAME']}','{$ip}','" . date('Y-m-d') . "','{$openSISVersion}','{$_SERVER['PHP_SELF']}','{$_SERVER['DOCUMENT_ROOT']}','{$_SERVER['SCRIPT_NAME']}','{$_REQUEST['modname']}','" . User('USERNAME') . "')");
}
/*if($openSISNotifyAddress)
mail($openSISNotifyAddress,'HACKING ATTEMPT',"INSERT INTO HACKING_LOG (HOST_NAME,IP_ADDRESS,LOGIN_DATE,VERSION,PHP_SELF,DOCUMENT_ROOT,SCRIPT_NAME,MODNAME,USERNAME) values('$_SERVER[SERVER_NAME]','$_SERVER[REMOTE_ADDR]','".date('Y-m-d')."','$openSISVersion','$_SERVER[PHP_SELF]','$_SERVER[DOCUMENT_ROOT]','$_SERVER[SCRIPT_NAME]','$_REQUEST[modname]','".User('USERNAME')."')");*/
if (false && function_exists('mysql_query')) {
if ($_SERVER['HTTP_X_FORWARDED_FOR']) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
$link = @mysql_connect('os4ed.com', 'openSIS_log', 'openSIS_log');
@mysql_select_db('openSIS_log');
@mysql_query("INSERT INTO HACKING_LOG (HOST_NAME,IP_ADDRESS,LOGIN_DATE,VERSION,PHP_SELF,DOCUMENT_ROOT,SCRIPT_NAME,MODNAME,USERNAME) values('{$_SERVER['SERVER_NAME']}','{$ip}','" . date('Y-m-d') . "','{$openSISVersion}','{$_SERVER['PHP_SELF']}','{$_SERVER['DOCUMENT_ROOT']}','{$_SERVER['SCRIPT_NAME']}','{$_REQUEST['modname']}','" . User('USERNAME') . "')");
@mysql_close($link);
/*$link = @mysql_connect('os4ed.com','openSIS_log','openSIS_log');
@mysql_select_db('openSIS_log');
@mysql_query("INSERT INTO HACKING_LOG (HOST_NAME,IP_ADDRESS,LOGIN_DATE,VERSION,PHP_SELF,DOCUMENT_ROOT,SCRIPT_NAME,MODNAME,USERNAME) values('$_SERVER[SERVER_NAME]','$_SERVER[REMOTE_ADDR]','".date('Y-m-d')."','$openSISVersion','$_SERVER[PHP_SELF]','$_SERVER[DOCUMENT_ROOT]','$_SERVER[SCRIPT_NAME]','$_REQUEST[modname]','".User('USERNAME')."')");
@mysql_close($link);*/
}
}
示例6: disconnect
public function disconnect()
{
if ($this->_link) {
@mysql_close($this->_link);
}
$this->_link = false;
}
示例7: close
function close()
{
if (is_resource($this->_conn)) {
mysql_close($this->_conn);
}
parent::_clear();
}
示例8: TearDown
protected function TearDown()
{
// Drop database if needed
mysql_query('DROP DATABASE IF EXISTS ' . WF_SQL_BASE) or die(__FILE__ . ':' . __LINE__ . ':' . mysql_error());
// Close connection
mysql_close() or die(__FILE__ . ':' . __LINE__ . ':' . mysql_error());
}
示例9: disconnect
public function disconnect()
{
if (isset($this->link)) {
mysql_close($this->link);
unset($this->link);
}
}
示例10: delete_article_by_alias
public function delete_article_by_alias($alias)
{
include "../db_connect.php";
$query = "DELETE FROM `articles` WHERE `alias` = '" . $alias . "' ";
$result = mysql_query($query);
mysql_close($link);
}
示例11: QUERY_SYSLOGS
function QUERY_SYSLOGS($sql)
{
$database = "syslogs";
$bd = @mysql_connect(":/var/run/syslogdb.sock", "root", null);
if (!$bd) {
echo "Connect failed\n";
return false;
}
$ok = @mysql_select_db($database, $bd);
if (!$ok) {
$errnum = @mysql_errno($bd);
$des = @mysql_error($bd);
echo "mysql_select_db [FAILED] N.{$errnum} DESC:{$des} mysql/QUERY_SQL\n";
return false;
}
$results = mysql_query($sql, $bd);
if (!$results) {
$errnum = @mysql_errno($bd);
$des = @mysql_error($bd);
echo "mysql_select_db [FAILED] N.{$errnum} DESC:{$des} mysql/QUERY_SQL\n";
return false;
@mysql_close($bd);
}
@mysql_close($bd);
return $results;
}
示例12: closedb
function closedb()
{
global $conn;
if ($conn) {
mysql_close($conn);
}
}
示例13: __destruct
/**
* Clos automatiquement la connexion MySQL.
*/
public function __destruct()
{
if ($this->connectionId) {
mysql_close($this->connectionId);
}
$this->connectionId = false;
}
示例14: closeCon
/** 关闭连接,没有返回值 */
function closeCon()
{
if ($this->isCon) {
mysql_close($this->link);
$this->isCon = false;
}
}
示例15: add_message
function add_message($locale, $groupid, $message)
{
global $mysqlprefix;
$link = connect();
perform_query("insert into {$mysqlprefix}chatresponses (locale,groupid,vcvalue) values ('" . mysql_real_escape_string($locale, $link) . "'," . ($groupid ? intval($groupid) . ", " : "null, ") . "'" . mysql_real_escape_string($message, $link) . "')", $link);
mysql_close($link);
}