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


PHP mssql_free_result函数代码示例

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


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

示例1: query

 /**
  * @param $sql
  *
  * @return array
  */
 public function query($sql)
 {
     //
     $this->connection = $this->getConnection();
     // Run query
     $query = mssql_query($sql, $this->connection);
     // On error
     if ($query === false) {
         Response::error(500, $_SERVER["SERVER_PROTOCOL"] . ' DB query failed (SQL): ' . mssql_get_last_message());
     }
     // E.g. boolean is returned if no rows (e.g. no resource found or on UPDATE)
     if ($query === true) {
         $response = $query;
     } else {
         // Response
         $response = array();
         //
         // Loop rows and add to response array
         if (mssql_num_rows($query) > 0) {
             while ($row = mssql_fetch_assoc($query)) {
                 $response[] = $row;
             }
         }
         // Free the query result
         mssql_free_result($query);
     }
     // Close link
     $this->closeConnection();
     //
     return $response;
 }
开发者ID:skrodal,项目名称:relay-fusjonator-api,代码行数:36,代码来源:relaysqlconnection.class.php

示例2: closeCursor

 public function closeCursor()
 {
     if ($this->_result) {
         mssql_free_result($this->_result);
         $this->_result = false;
     }
 }
开发者ID:PHPcomaptibility,项目名称:PHPPDO,代码行数:7,代码来源:mssql_statement.php

示例3: econnect_copy

function econnect_copy($sql, $key, $node)
{
    global $old_gp;
    global $new_gp;
    $name = "";
    $inc = 0;
    $break = 0;
    $st_proc = "";
    $rset = mssql_query($sql, $old_gp);
    while ($line = mssql_fetch_assoc($rset)) {
        $st_proc = "";
        $break = 0;
        for ($inc = 0; $inc < mssql_num_fields($rset); $inc++, $break++) {
            $name = trim(mssql_field_name($rset, $inc));
            if ($break > 1) {
                $st_proc .= "\n   ";
                $break = 0;
            }
            $st_proc .= "@I_v{$name}='" . str_replace("'", "''", trim($line[$name])) . "', ";
        }
        $st_proc = "\n declare @O_iErrorState int; declare @oErrString varchar(255); \n select @O_iErrorState = 0;\n exec {$node}\n   {$st_proc} @oErrString = @oErrString output,@O_iErrorState = @O_iErrorState output;\n select @O_iErrorState as ret_val, ErrorDesc from  DYNAMICS..taErrorCode where errorcode = @O_iErrorState;\n ";
        #PHP bug fix work around
        $st_proc = str_replace("@I_vUnrealized_Purchase_Price_Vari=", "@I_vUnrealized_Purchase_Price_Variance_Acct=", $st_proc);
        echo "{$node} " . trim($line[$key]) . ". ";
        $rset_x = mssql_query($st_proc, $new_gp);
        $line_x = mssql_fetch_assoc($rset_x);
        if ($line_x["ret_val"] == 0) {
            echo "Successful.\n";
        } else {
            echo "Failed. Reason: " . trim($line_x["ErrorDesc"]) . "\n{$st_proc}\n";
            #exit();
        }
        mssql_free_result($rset_x);
    }
}
开发者ID:afindlator,项目名称:gpApi,代码行数:35,代码来源:copy_gp.php

示例4: executeQuery

 private function executeQuery()
 {
     $return = false;
     if ($this->queryType == 'other') {
         if (mssql_query($this->query, $this->link) === true) {
             $return = true;
             $this->error = mssql_get_last_message();
         }
     } else {
         if ($result = mssql_query($this->query, $this->link)) {
             // Conteo de registros
             if ($this->queryType == 'insert' || $this->queryType == 'update' || $this->queryType == 'delete') {
                 $this->numRows = mssql_rows_affected($this->link);
                 $return = true;
             } else {
                 $this->numRows = mssql_num_rows($result);
                 $fetchType = MSSQL_NUM;
                 if ($this->queryReturn == 'assoc') {
                     $fetchType = MSSQL_ASSOC;
                 } elseif ($this->queryReturn == 'both') {
                     $fetchType = MSSQL_BOTH;
                 }
                 $return = array();
                 while ($row = mssql_fetch_array($result, $fetchType)) {
                     array_push($return, $row);
                 }
             }
             $this->error = mssql_get_last_message();
             mssql_free_result($result);
         } else {
             $this->error = mssql_get_last_message();
         }
     }
     return $return;
 }
开发者ID:foreverphp,项目名称:framework,代码行数:35,代码来源:MSSQLEngine.php

示例5: free_result

 function free_result()
 {
     if (is_resource($this->result_id)) {
         mssql_free_result($this->result_id);
         $this->result_id = FALSE;
     }
 }
开发者ID:pepegarcia,项目名称:publicidadoficialdemo-1,代码行数:7,代码来源:mssql_result.php

示例6: free

 /**
  * This function frees the command reference.
  *
  * @access public
  * @override
  */
 public function free()
 {
     if ($this->command !== NULL) {
         @mssql_free_result($this->command);
         $this->command = NULL;
         $this->record = FALSE;
     }
 }
开发者ID:ruslankus,项目名称:invoice-crm,代码行数:14,代码来源:Standard.php

示例7: free_result

 function free_result()
 {
     if ($this->Query_ID) {
         mssql_free_result($this->Query_ID);
     }
     $this->Query_ID = 0;
     $this->VEOF = -1;
 }
开发者ID:HaakonME,项目名称:porticoestate,代码行数:8,代码来源:class.db_mssql.inc.php

示例8: close

 public function close()
 {
     if ($this->rsrc) {
         mssql_free_result($this->rsrc);
         $this->rsrc = null;
     }
     $this->current = null;
 }
开发者ID:pzhu2004,项目名称:moodle,代码行数:8,代码来源:mssql_native_moodle_recordset.php

示例9: getLastId

 public function getLastId()
 {
     $last_id = false;
     $resource = mssql_query("SELECT @@identity AS id", $this->link);
     if ($row = mssql_fetch_row($resource)) {
         $last_id = trim($row[0]);
     }
     mssql_free_result($resource);
     return $last_id;
 }
开发者ID:ahmedkato,项目名称:openshift-opencart,代码行数:10,代码来源:mmsql.php

示例10: getOneColumnAsArray

 function getOneColumnAsArray()
 {
     $column = array();
     $queryId = $this->connection->execute($this->getSQL());
     while (is_array($row = mssql_fetch_row($queryId))) {
         $column[] = is_numeric($row[0]) ? $row[0] : mb_convert_encoding($row[0], 'UTF-8', 'Windows-1251');
     }
     mssql_free_result($queryId);
     return $column;
 }
开发者ID:r-kitaev,项目名称:limb,代码行数:10,代码来源:lmbMssqlQueryStatement.class.php

示例11: exec

 public function exec(&$statement)
 {
     if ($result = @mssql_query($statement, $this->link)) {
         if (is_resource($result)) {
             mssql_free_result($result);
             return 0;
         }
         return mssql_rows_affected($this->link);
     }
     return false;
 }
开发者ID:PHPcomaptibility,项目名称:PHPPDO,代码行数:11,代码来源:mssql.php

示例12: loadTables

 function loadTables()
 {
     if ($this->isExisting && !$this->isTablesLoaded) {
         $queryId = $this->connection->execute("select TABLE_NAME FROM INFORMATION_SCHEMA.TABLES where TABLE_CATALOG='" . $this->name . "'");
         while (is_array($row = mssql_fetch_row($queryId))) {
             $this->tables[$row[0]] = null;
         }
         mssql_free_result($queryId);
         $this->isTablesLoaded = true;
     }
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:11,代码来源:lmbMssqlDbInfo.class.php

示例13: getNamaBulanById

 public function getNamaBulanById($id)
 {
     $sql = 'SELECT Bulan FROM ' . $this->table . ' WHERE BulanId=' . $id;
     $result = mssql_query($sql);
     if (mssql_num_rows($result) > 0) {
         while ($val = mssql_fetch_assoc($result)) {
             $namaBulan = $val['Bulan'];
         }
     }
     mssql_free_result($result);
     return $bulan;
 }
开发者ID:aldrymaulana,项目名称:mdk-php,代码行数:12,代码来源:bulan-service.php

示例14: getKecamatanByKelurahan

 public function getKecamatanByKelurahan($id)
 {
     $sql = 'SELECT a.Nama, a.KecamatanId, a.KodeDepdagri FROM ' . $this->table . ' a INNER JOIN M_Kelurahan b on a.KecamatanId=b.KecamatanId WHERE b.KelurahanId=' . $id;
     $result = mssql_query($sql);
     $data = array();
     if (mssql_num_rows($result) > 0) {
         while ($val = mssql_fetch_assoc($result)) {
             $data[] = array('KecamatanId' => $val['KecamatanId'], 'Nama' => $val['Nama'], 'KodeDedagri' => $val['KodeDepdagri']);
         }
     }
     mssql_free_result($result);
     return $data;
 }
开发者ID:aldrymaulana,项目名称:mdk-php,代码行数:13,代码来源:kecamatan-service.php

示例15: getAlasanTidakKbById

 public function getAlasanTidakKbById($id)
 {
     $sql = 'SELECT * FROM ' . $this->table . ' WHERE ID=' . $id;
     $result = mssql_query($sql);
     $data = array();
     if (mssql_num_rows($result) > 0) {
         while ($val = mssql_fetch_assoc($result)) {
             $data[] = array('ID' => $val['ID'], 'Alasan' => $val['Alasan'], 'SortNumber' => $val['SortNumber'], 'IsActive' => $val['IsActive']);
         }
     }
     mssql_free_result($result);
     return $data;
 }
开发者ID:aldrymaulana,项目名称:mdk-php,代码行数:13,代码来源:alasan-tidak-kb-service.php


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