當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。