本文整理汇总了PHP中mssql_close函数的典型用法代码示例。如果您正苦于以下问题:PHP mssql_close函数的具体用法?PHP mssql_close怎么用?PHP mssql_close使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mssql_close函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: disconnect
function disconnect()
{
if ($this->connectionId) {
mssql_close($this->connectionId);
$this->connectionId = null;
}
}
示例2: disconnect
/** Disconnects from database * */
function disconnect()
{
if (DB_TYPE == 'sqlsrv') {
if (@sqlsrv_close($this->_dbHandle) != 0) {
return 1;
} else {
return 0;
}
} else {
if (DB_TYPE == 'mssql') {
if (@mssql_close($this->_dbHandle) != 0) {
return 1;
} else {
return 0;
}
} else {
if (DB_TYPE == 'mysql') {
if (@mysql_close($this->_dbHandle) != 0) {
return 1;
} else {
return 0;
}
}
}
}
}
示例3: __destruct
function __destruct()
{
if ($this->link) {
mssql_close($this->link);
}
$this->link = null;
}
示例4: __destruct
public function __destruct()
{
/*
| About:
| -> Close the connection and returns the elapsed time.
*/
if (!empty($this->connection['debugMode'])) {
$this->errorHandling();
}
switch ($this->connection['db_type']) {
case 'mysql':
$this->conn->close();
break;
case 'mssql':
mssql_close($this->conn);
break;
case 'sqlserv':
sqlsrv_close($this->conn);
break;
case 'pgsql':
pg_close($this->conn);
break;
}
return $this->elapsedTime();
}
示例5: dbactionAdd
function dbactionAdd()
{
print "starting\n";
if (!windowsOs()) {
throw new lxException('mssql_is_only_on_windows', '', '');
}
print "\n mantu\n";
$req = mssql_connect("localhost,1433");
if (!$req) {
throw new lxException('MsSql Connection is Failed', '', '');
}
$loginname = $this->main->username;
$dbname = $loginname;
print "\n" . $loginname;
$pass = $this->main->dbpassword;
print "\n" . $pass;
$result = mssql_query("select loginname from syslogins where loginname='{$loginname}'");
$row = mssql_fetch_array($result, MSSQL_ASSOC);
if (!$row) {
mssql_query("sp_addlogin '{$loginname}', '{$pass}'");
} else {
print "user already exist by this name\n";
throw new Exception("couldn't create {$loginname}--already user exist\n");
}
print "executing\n";
try {
mssql_query("create database {$dbname}");
} catch (Exception $e) {
print "\n ERROR: Create database";
}
mssql_query("use {$dbname}");
mssql_query("sp_adduser '{$loginname}', '{$loginname}', 'db_owner'");
mssql_close();
print "\ndone\n";
}
示例6: close
/**
* 关闭数据库连接
*/
function close()
{
if ($this->conn) {
mssql_close($this->conn);
}
parent::close();
}
示例7: closeConnection
public function closeConnection()
{
if ($this->isConnected()) {
mssql_close($this->_connection);
}
$this->_connection = null;
}
示例8: sql_close
function sql_close()
{
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
if ($this->db_connect_id) {
//
// Commit any remaining transactions
//
if ($this->in_transaction) {
@mssql_query("COMMIT", $this->db_connect_id);
}
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$this->sql_time += $endtime - $starttime;
return @mssql_close($this->db_connect_id);
} else {
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$this->sql_time += $endtime - $starttime;
return false;
}
}
示例9: close
/**
* 关闭数据库,如果数据库连接已经打开则关闭它
* 请在调用connect()并处理后使用close()
*
* @return void
*/
public function close()
{
if ($this->linkId) {
mssql_close($this->linkId);
$this->linkId = false;
}
}
示例10: getProductos
function getProductos()
{
$myServer = "172.30.5.49";
$myUser = "UsrPsg";
$myPass = "PsGcRm1402*LaU+";
$myDB = "LAUMAYER";
$dbhandle = mssql_connect($myServer, $myUser, $myPass) or die("Couldn't connect to SQL Server on {$myServer}");
$selected = mssql_select_db($myDB, $dbhandle) or die("Couldn't open database {$myDB}");
//Realiza el query en la base de datos
$mysqli = makeSqlConnection();
//$sql = "SELECT * FROM psg_productos a LEFT JOIN psg_productos_cstm ac ON a.id = ac.id_c";
$sql = "SELECT id,name FROM psg_productos where deleted ='0'";
$res = $mysqli->query($sql);
$rows = array();
while ($r = mysqli_fetch_assoc($res)) {
$obj = (object) $r;
$querySaldo = "Select dbo.F_Saldo_Bodega_Informe(Year(GETDATE()),MONTH(GETDATE()),'" . $r['id'] . "','BODPRDCTO','T','C') as Saldo";
$result = mssql_query($querySaldo);
if ($row = mssql_fetch_array($result)) {
$obj->saldo = $row['Saldo'];
}
$a = (array) $obj;
$rows[] = $a;
}
mssql_close($dbhandle);
if (empty($rows)) {
return '{"results" :[]}';
} else {
//Convierte el arreglo en json y lo retorna
$temp = json_encode(utf8ize($rows));
return '{"results" :' . $temp . '}';
}
}
示例11: close
/**
* MSSQL::close()
*
* Close the connection
*
* @return bool
* @access public
* @author Teye Heimans
*/
function close()
{
if ($this->_isConnected) {
$this->_isConnected = false;
return mssql_close($this->_conn);
}
}
示例12: Connect
function Connect()
{
if ($this->connection != 0) {
if (!strcmp($this->connected_host, $this->host) && !strcmp($this->connected_user, $this->user) && !strcmp($this->connected_password, $this->password) && $this->opened_persistent == $this->persistent) {
return 1;
}
$this->Close();
}
$function = $this->persistent ? "mssql_pconnect" : "mssql_connect";
if (!function_exists($function)) {
return $this->SetError("Connect", "Microsoft SQL server support is not available in this PHP configuration");
}
if (($this->connection = @$function($this->host, $this->user, $this->password)) <= 0) {
return $this->SetMSSQLError("Connect", "Could not connect to the Microsoft SQL server");
}
if (strcmp($this->database_name, "") && !@mssql_select_db($this->database_name, $this->connection)) {
$this->SetMSSQLError("Connect", "Could not select a Microsoft SQL server database");
mssql_close($this->connection);
$this->connection = 0;
return 0;
}
$this->selected_database = $this->database_name;
if (!$this->auto_commit && !$this->DoQuery("BEGIN TRANSACTION")) {
$this->SetMSSQLError("Connect", "Could not begin the initial transaction");
mssql_close($this->connection);
$this->connection = 0;
return 0;
}
$this->connected_host = $this->host;
$this->connected_user = $this->user;
$this->connected_password = $this->password;
$this->opened_persistent = $this->persistent;
return 1;
}
示例13: Close
/**
* Close the connection to the database if still connected.
*
* @return bool Returns TRUE if the connection was closed, FALSE if it failed.
*/
function Close()
{
if (mssql_close($this->link)) {
$this->link = NULL;
return TRUE;
}
return FALSE;
}
示例14: disconnect
function disconnect()
{
if (!$this->link_identifier) {
return;
}
@mssql_close($this->link_identifier);
$this->link_identifier = false;
}
示例15: close
/**
* Disconnect
*
* @return bool success
*/
public function close()
{
if ($this->handle && ($r = mssql_close($this->handle))) {
$this->handle = NULL;
return $r;
}
return FALSE;
}