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


PHP mssql_close函數代碼示例

本文整理匯總了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;
     }
 }
開發者ID:snowjobgit,項目名稱:limb,代碼行數:7,代碼來源:lmbMssqlConnection.class.php

示例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;
                 }
             }
         }
     }
 }
開發者ID:bciv,項目名稱:COMS,代碼行數:27,代碼來源:sqlquery.class.php

示例3: __destruct

 function __destruct()
 {
     if ($this->link) {
         mssql_close($this->link);
     }
     $this->link = null;
 }
開發者ID:axoquen,項目名稱:tt780,代碼行數:7,代碼來源:MSSQL_Connector.php

示例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();
 }
開發者ID:samukt,項目名稱:T-Rex,代碼行數:25,代碼來源:class_db.php

示例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";
 }
開發者ID:hypervm-ng,項目名稱:hypervm-ng,代碼行數:35,代碼來源:mssqldb__mssqllib.php

示例6: close

 /**
  * 關閉數據庫連接
  */
 function close()
 {
     if ($this->conn) {
         mssql_close($this->conn);
     }
     parent::close();
 }
開發者ID:joaosigno,項目名稱:dazake-job,代碼行數:10,代碼來源:Mssql5.php

示例7: closeConnection

 public function closeConnection()
 {
     if ($this->isConnected()) {
         mssql_close($this->_connection);
     }
     $this->_connection = null;
 }
開發者ID:diglin,項目名稱:diglin_mssql,代碼行數:7,代碼來源:Mssql.php

示例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;
     }
 }
開發者ID:BackupTheBerlios,項目名稱:phpbbsfp,代碼行數:28,代碼來源:mssql.php

示例9: close

 /**
  * 關閉數據庫,如果數據庫連接已經打開則關閉它
  * 請在調用connect()並處理後使用close()
  *
  * @return void
  */
 public function close()
 {
     if ($this->linkId) {
         mssql_close($this->linkId);
         $this->linkId = false;
     }
 }
開發者ID:GameCrusherTechnology,項目名稱:HeroTowerServer,代碼行數:13,代碼來源:MooMsSQL.class.php

示例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 . '}';
    }
}
開發者ID:ekutor,項目名稱:hermes,代碼行數:33,代碼來源:getProductos.php

示例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);
     }
 }
開發者ID:jwiegel,項目名稱:FormHandler,代碼行數:16,代碼來源:class.MSSQL.php

示例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;
 }
開發者ID:BackupTheBerlios,項目名稱:zvs,代碼行數:34,代碼來源:metabase_mssql.php

示例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;
 }
開發者ID:JAMNConsultoria,項目名稱:snaids,代碼行數:13,代碼來源:DB_MSSQL.class.php

示例14: disconnect

 function disconnect()
 {
     if (!$this->link_identifier) {
         return;
     }
     @mssql_close($this->link_identifier);
     $this->link_identifier = false;
 }
開發者ID:BackupTheBerlios,項目名稱:viperals-svn,代碼行數:8,代碼來源:mssql.php

示例15: close

 /**
  * Disconnect
  *
  * @return  bool success
  */
 public function close()
 {
     if ($this->handle && ($r = mssql_close($this->handle))) {
         $this->handle = NULL;
         return $r;
     }
     return FALSE;
 }
開發者ID:melogamepay,項目名稱:xp-framework,代碼行數:13,代碼來源:MsSQLConnection.class.php


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