• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP mssql_close函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了mssql_close函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: close

 public function close()
 {
     //$this->dispatchEvent('preClose', $this);
     if ($this->conn_id && $this->state != self::CLOSED) {
         $this->state = self::CLOSED;
         mssql_close($this->conn_id);
     }
     //$this->dispatchEvent('posClose', $this);
 }
开发者ID:phpburn,项目名称:phpburn,代码行数:9,代码来源:PDO_MSSQL.php


示例17: __destruct

 /**
  * Database object destructor
  *
  * @return boolean
  * @since 1.5
  */
 function __destruct()
 {
     $return = false;
     if (is_resource($this->_resource)) {
         $return = mssql_close($this->_resource);
         $this->connected = false;
     }
     return $return;
 }
开发者ID:Jonathonbyrd,项目名称:SportsCapping-Experts,代码行数:15,代码来源:mssql.php


示例18: close

 /**
  * This function closes an open connection.
  *
  * @access public
  * @override
  * @return boolean                              whether an open connection was closed
  */
 public function close()
 {
     if ($this->is_connected()) {
         if (!@mssql_close($this->resource)) {
             return FALSE;
         }
         $this->resource = NULL;
     }
     return TRUE;
 }
开发者ID:ruslankus,项目名称:invoice-crm,代码行数:17,代码来源:Standard.php


示例19: close

 protected function close()
 {
     $msclose = mssql_close($this->connection);
     if ($msclose === FALSE) {
         wLog(get_class($this), "Couldn't close db connection");
         wLog(get_class($this), "Last message on server was: " . mssql_get_last_message());
         die("Couldn't close db connection");
     }
     return;
 }
开发者ID:BackupTheBerlios,项目名称:phpapi2db-svn,代码行数:10,代码来源:class.DbMssql.php


示例20: close

 public function close()
 {
     $this->conn_open = false;
     if (!$this->reuse_connection) {
         if ($this->handle && !$this->data_result) {
             return mssql_close($this->handle);
         }
     }
     return true;
 }
开发者ID:codifyllc,项目名称:phpopenfw,代码行数:10,代码来源:dt_mssql.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP mssql_connect函数代码示例发布时间:2022-05-15
下一篇:
PHP mssql_bind函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap