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

PHP mssql_fetch_object函数代码示例

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

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



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

示例1: FindItem

 public function FindItem()
 {
     $resultQ = mssql_query("select [Name] from [Character] where (charindex (0x" . $this->ProductSerial . ", Inventory) %" . DIVISOR / 2 . "=4)");
     while ($result = mssql_fetch_object($resultQ)) {
         echo Print_error("<ul><li>Item foi encontrado no invent&aacute;rio do char: " . $result->Name . ".</li></ul>");
         $exitFunction = true;
     }
     unset($result, $resultQ);
     $findColumnsQ = mssql_query("sp_MShelpcolumns N'dbo.warehouse', null, 'id', 1");
     while ($findColumns = mssql_fetch_object($findColumnsQ)) {
         if ($findColumns->col_typename == "varbinary") {
             $resultQ = mssql_query("select [AccountId] from [warehouse] where (charindex (0x" . $this->ProductSerial . ", " . $findColumns->col_name . ") %" . DIVISOR / 2 . "=4)");
             while ($result = mssql_fetch_object($resultQ)) {
                 echo Print_error("<ul><li>Encontrado no bau do login: " . $result->AccountId . ". Tabela: warehouse, coluna: {$findColumns->name}</li></ul>");
                 $exitFunction = true;
             }
         }
     }
     unset($result, $resultQ);
     $resultQ = mssql_query("select [AccountId],[Number] from [ExtWarehouse] where (charindex (0x" . $this->ProductSerial . ", Items) %" . DIVISOR / 2 . "=4)");
     while ($result = mssql_fetch_object($resultQ)) {
         echo Print_error("<ul><li>Item foi encontrado no bau extra " . $result->Number . " do login: " . $result->AccountId . ".</li></ul>");
         $exitFunction = true;
     }
     unset($result, $resultQ);
     $resultQ = @mssql_query("select [AccountId] from [ExtWarehouseVirtual] where (charindex (0x" . $this->ProductSerial . ", Item) %" . DIVISOR / 2 . "=4)");
     while ($result = @mssql_fetch_object($resultQ)) {
         echo Print_error("<ul><li>Item foi encontrado no bau virtual do login: " . $result->AccountId . ".</li></ul>");
         $exitFunction = true;
     }
     unset($result, $resultQ);
     if ($exitFunction == false) {
         echo "<ul><li>Esse item n&atilde;o foi encontrado no servidor.</li></ul>";
     }
 }
开发者ID:neilor,项目名称:MuShopping-v3,代码行数:35,代码来源:itemfind.class.php


示例2: getInventory

 public function getInventory()
 {
     global $ldMssql;
     try {
         switch ($this->dbVersion) {
             case 1:
             case 2:
                 $this->itemSize = 10 * 76;
                 break;
             case 3:
                 $this->itemSize = 16 * $this->slotNumbers;
                 break;
         }
         /*
         $getVault = $ldMssql->query("DECLARE @BINARYITEMS VARBINARY({$this->itemSize}); SELECT @BINARYITEMS = [Inventory] FROM [".DATABASE_CHARACTERS."].[dbo].[Character] WHERE [AccountID] = '{$this->account}' AND [Name] = '{$this->character}'; PRINT @BINARYITEMS;");
         $this->binaryCode = substr(mssql_get_last_message($getVault),2);
         */
         $getVault = $ldMssql->query("USE [" . DATABASE_ACCOUNTS . "]; SELECT CONVERT(TEXT, CONVERT(VARCHAR(" . $this->itemSize . "), Inventory)) [Inventory] FROM [Character] WHERE [AccountID] = '{$this->account}' AND [Name] = '{$this->character}'; USE [" . DATABASE . "]");
         $getVault = mssql_fetch_object($getVault);
         $this->binaryCode = strtoupper(bin2hex($getVault->Items));
         if (empty($this->binaryCode)) {
             throw new Exception("Inválid inventory.");
         }
     } catch (Exception $msg) {
         exit("Inventory error: " . $msg->getMessage());
     }
 }
开发者ID:neilor,项目名称:MuSite-v2-5-x,代码行数:27,代码来源:ldInventory.class.php


示例3: fetch

 public function fetch($res)
 {
     $result = array();
     while ($data = mssql_fetch_object($res)) {
         $result[] = $data;
     }
     return $result;
 }
开发者ID:hendisantika,项目名称:ajax-crud-bootstrap,代码行数:8,代码来源:sqlsrv.php


示例4: getCustomersMultiTable

 public function getCustomersMultiTable()
 {
     $resultSet = $this->execute("select top 10 * from customers");
     $resultArr = array();
     while ($row = mssql_fetch_object($resultArr)) {
         $resultArr[] = $row;
     }
     return array($resultArr, $resultArr);
 }
开发者ID:sigmadesarrollo,项目名称:logisoft,代码行数:9,代码来源:DatabaseTestMsSql.php


示例5: checkPermission

 private function checkPermission()
 {
     $SQL_Q = $this->query("SELECT previlegy FROM dbo.webPrevilegy WHERE username='" . $_SESSION['LOGIN'] . "'");
     $SQL = mssql_fetch_object($SQL_Q);
     if ($SQL->previlegy < 1) {
         return false;
     } else {
         return true;
     }
 }
开发者ID:neilor,项目名称:MuSite-v2-5-x,代码行数:10,代码来源:ldpanelgamemaster.class.php


示例6: retrieve

 public function retrieve($patientId)
 {
     //Setup mssql connection
     $connection = $this->connectToMedboss();
     $labRequests = mssql_query("SELECT * FROM {$this->labRequestView} WHERE (PatientNumber='{$patientId}')", $connection);
     while ($patientData = mssql_fetch_object($labRequests, $connection)) {
         //save received data in staging table and to internal tables
         $this->process($patientData);
     }
 }
开发者ID:echiteri,项目名称:iBLIS,代码行数:10,代码来源:MedbossInterfacer.php


示例7: checkLogin

 /**
  * Checa se o usuário esta logado, e retorna um objecto com o numero do previlegio dele caso esteja logado.
  */
 public function checkLogin()
 {
     global $ldMssql;
     if (!isset($_SESSION['LOGIN']) && empty($_SESSION['LOGIN'])) {
         return false;
     }
     $checkPrevilegy = $ldMssql->query("SELECT previlegy FROM dbo.webPrevilegy WHERE username='" . $_SESSION['LOGIN'] . "'");
     if (mssql_num_rows($checkPrevilegy) == 0) {
         return (int) 0;
     } else {
         return mssql_fetch_object($checkPrevilegy);
     }
 }
开发者ID:neilor,项目名称:MuSite-v2-5-x,代码行数:16,代码来源:sample.module.php


示例8: listAllNotices

 private function listAllNotices()
 {
     global $ldTpl;
     $findNoticeQ = $this->query("SELECT id,subject,date FROM dbo.webNotices ORDER BY date DESC");
     if (mssql_num_rows($findNoticeQ) == 0) {
         $tempTpl = NOTICE_NOT_EXISTS_NOTICES;
     } else {
         $tempTpl .= "<ul>";
         while ($findNotice = mssql_fetch_object($findNoticeQ)) {
             $tempTpl .= "<li><a href=\"?page=readNotice&amp;id=" . $findNotice->id . "\">" . $findNotice->subject . "</a> - " . date("[d/m/Y g:i a]", $findNotice->date) . "</li>";
         }
     }
     $ldTpl->set("ResultNotices", $tempTpl);
 }
开发者ID:neilor,项目名称:MuSite-v2-5-x,代码行数:14,代码来源:ldnotice.class.php


示例9: loadBanned

 private function loadBanned($type)
 {
     global $ldTpl;
     $findBannedQ = $this->query("SELECT * FROM " . DATABASE . ".dbo.webBanneds WHERE type = {$type} ORDER BY name DESC");
     if (mssql_num_rows($findBannedQ) == 0) {
         $tempTpl = "<tr><td align='center' bgcolor='#EDEBDC' colspan='4'>" . BANNED_NO_USERS . "</td></tr>";
     } else {
         while ($findBanned = mssql_fetch_object($findBannedQ)) {
             $tempTpl .= "<tr>\n                                  <td align='center' bgcolor='#EDEBDC'>" . $findBanned->name . "</td>\n                                  <td align='center' bgcolor='#EDEBDC'>" . date("d/m/Y G:i", $findBanned->dateend) . "</td>\n                                  <td align='center' bgcolor='#EDEBDC'>" . $findBanned->bannedBy . "</td>\n                                  <td align='center' bgcolor='#EDEBDC'>" . $findBanned->description . "</td>                           \n                                </tr>";
         }
     }
     $ldTpl->set("BANNED_RESULT", $tempTpl);
     unset($tempTpl);
 }
开发者ID:neilor,项目名称:MuSite-v2-5-x,代码行数:14,代码来源:ldbanned.class.php


示例10: consultaDadosUsuario

 public function consultaDadosUsuario($matricula)
 {
     $matricula = addslashes($matricula);
     $this->conecta();
     $SQL = "SELECT * FROM dbo.pessoa WHERE cod_pessoa_aux = '{$matricula}'";
     $res = mssql_query($SQL, $this->getConmssql());
     // return $res;
     if (mssql_num_rows($res) > 0) {
         $user = mssql_fetch_object($res);
         return $user;
     } else {
         return false;
     }
 }
开发者ID:VicenteTerra,项目名称:validarec,代码行数:14,代码来源:integracaoPergamum.php


示例11: GetVaultContent

 public function GetVaultContent()
 {
     $getLenghts = $this->query("SELECT [length] FROM [syscolumns] WHERE OBJECT_NAME([id]) = 'warehouse' AND [name] = 'Items';");
     $getLenghts = mssql_fetch_object($getLenghts);
     $this->Varbinary = $getLenghts->length;
     $this->LineCounts = $getLenghts->length * 2 / (constant("SYSTEM_DBVERSION") == 1 ? 20 : 32) / 8;
     $this->SlotCounts = $getLenghts->length * 2 / (constant("SYSTEM_DBVERSION") == 1 ? 20 : 32);
     $SQL_Q = $this->query("SELECT 1 FROM warehouse WHERE Accountid='" . $_SESSION['Login'] . "'");
     if (mssql_num_rows($SQL_Q) == 0) {
         $this->query("INSERT INTO warehouse (AccountID, Items, Money, EndUseDate, DbVersion, pw) VALUES ('" . $_SESSION['Login'] . "', 0x" . str_pad("", $this->Varbinary * 2, "F") . ", 0, GetDate(), " . constant("SYSTEM_DBVERSION") . ", 0);");
     }
     $SQL_Q = $this->query("DECLARE @vault varbinary(" . $this->Varbinary . "); SELECT @vault = items FROM warehouse WHERE AccountID='" . $_SESSION['Login'] . "' " . (constant("ENCGAMES_S6") === true ? " AND VaultID = 1" : NULL) . "; PRINT @vault;");
     $this->Vault_Content = substr(mssql_get_last_message($SQL_Q), 2);
 }
开发者ID:neilor,项目名称:MuShopping-v3,代码行数:14,代码来源:vault.class.php


示例12: __construct

 public function __construct()
 {
     global $ODBC, $LD_Items;
     $_GET['ProductID'] = (int) $_GET['ProductID'];
     $SQL_Q = $this->query("SELECT ConnectStat FROM MEMB_STAT WHERE memb___id='" . $_SESSION['Login'] . "'");
     $SQL = mssql_fetch_object($SQL_Q);
     if ($SQL->ConnectStat != 0) {
         exit(Print_error("<ul><li>Voc&ecirc; deve estar offline do jogo para efetuar essa a&ccedil;&atilde;o!</li></ul>"));
     }
     $searchKitQ = $ODBC->query("SELECT priceFix FROM Kits WHERE active = 1 AND Number = " . $_GET['ProductID']);
     if (odbc_num_rows($searchKitQ) == 0) {
         exit(Print_error("<script type=\"text/javascript\">alert(\"Erro kit n&atilde;o cadastrado.\"); window.location='?';</script>"));
     }
     $searchItensKitQ = $ODBC->query("SELECT * FROM KitsItemsDetails WHERE kitNumber = " . $_GET['ProductID']);
     echo "<ul><li>Aguarde em quanto sua compra &eacute; processada.</li><br />";
     //Inicio Função independente para cobrar o kit
     $searchKit = odbc_fetch_object($searchKitQ);
     $SQL_Q = $this->query("SELECT " . GOLDCOLUMN . " FROM " . GOLDTABLE . " WHERE " . GOLDMEMBIDENT . " = '" . $_SESSION['Login'] . "'");
     $SQL_R = mssql_fetch_row($SQL_Q);
     if ($SQL_R[0] < $searchKit->priceFix) {
         exit(Print_error("<ul><li>Desculpe, essa compra n&atilde;o pode ser realizada, pois seu saldo de " . GOLDNAME . " &eacute; insuficiente.</li></ul>"));
     }
     $SQL_Q = $this->query("UPDATE " . GOLDTABLE . " SET " . GOLDCOLUMN . " = " . GOLDCOLUMN . "-" . $searchKit->priceFix . " WHERE " . GOLDMEMBIDENT . " = '" . $_SESSION['Login'] . "' AND " . GOLDCOLUMN . " >= " . $searchKit->priceFix . "; select @@rowcount as rows;");
     $SQL_R = mssql_fetch_object($SQL_Q);
     if ((int) $SQL_R->rows == 0) {
         exit(Print_error("<ul><li>Erro ao cobrar pelo kit.</li></ul>"));
     }
     //Fim Função independente para cobrar o kit
     $ODBC->query("UPDATE Kits SET solds=solds+1 WHERE Number=" . $_GET['ProductID']);
     $searchLastSoldNumberQ = $ODBC->query("SELECT max(Number) as Numb FROM LogSoldsKits");
     $searchLastSoldNumber = odbc_fetch_object($searchLastSoldNumberQ);
     $searchLastSoldNumber->Numb = (int) $searchLastSoldNumber->Numb + 1;
     $ODBC->query("INSERT INTO LogSoldsKits (login,kitNumber,price,data) VALUES ('{$_SESSION['Login']}', {$_GET['ProductID']}, {$searchKit->priceFix}, '" . time() . "')");
     require "sockets.lib.php";
     //exit(var_dump($socketLib));
     while ($searchItensKit = odbc_fetch_object($searchItensKitQ)) {
         //var_dump($searchItensKit);
         $LD_FinishBuy = new LD_FinishBuy($searchItensKit->itemNumber, $searchItensKit->fixLVL, $searchItensKit->fixOP, $searchItensKit->fixANC, $searchItensKit->fixSkill == 0 ? "false" : "true", $searchItensKit->fixLuck == 0 ? "false" : "true", $searchItensKit->fixOpEx1 == 0 ? "false" : "true", $searchItensKit->fixOpEx2 == 0 ? "false" : "true", $searchItensKit->fixOpEx3 == 0 ? "false" : "true", $searchItensKit->fixOpEx4 == 0 ? "false" : "true", $searchItensKit->fixOpEx5 == 0 ? "false" : "true", $searchItensKit->fixOpEx6 == 0 ? "false" : "true", $searchItensKit->fixJH, $searchItensKit->fixRefine == 0 ? "false" : "true", $searchItensKit->fixSocket1 == $socketLib['notSocket'] ? "false" : "true", $searchItensKit->fixSocket2 == $socketLib['notSocket'] ? "false" : "true", $searchItensKit->fixSocket3 == $socketLib['notSocket'] ? "false" : "true", $searchItensKit->fixSocket4 == $socketLib['notSocket'] ? "false" : "true", $searchItensKit->fixSocket5 == $socketLib['notSocket'] ? "false" : "true", $searchItensKit->fixSocket1, $searchItensKit->fixSocket2, $searchItensKit->fixSocket3, $searchItensKit->fixSocket4, $searchItensKit->fixSocket5, true);
         $ODBC->query("INSERT INTO LogSoldsKitsDetails (NumberSoldKit,login,itemId,itemSerial) VALUES ({$searchLastSoldNumber->Numb}, '{$_SESSION['Login']}', '{$searchItensKit->itemNumber}', '{$LD_Items->Item_Serial}')");
         if ($LD_FinishBuy->delivered == true) {
             echo "<li>Item: <strong>{$LD_FinishBuy->NAME}</strong>, entregue.</li>";
         } else {
             echo "<li>Item: <strong>{$LD_FinishBuy->NAME}</strong>, n&atilde;o houve espa&ccedil;o. <br />Libere espa&ccedil;o no bau e reenvie o item pelo hist&oacute;rico de compras.</li>";
         }
         unset($LD_FinishBuy);
     }
     echo "<br /><li>Compra finalizada com sucesso!</li></ul>";
 }
开发者ID:neilor,项目名称:MuShopping-v3,代码行数:48,代码来源:finishbuykits.class.php


示例13: __construct

 public function __construct()
 {
     global $ldTpl, $TABLES_CONFIGS, $PANELUSER_MODULE;
     $tempTpl .= "<table border='0' width='100%'>\n\t\t\t\t\t\t  <tr>\n\t\t\t\t\t\t   <td align='center' bgcolor='#E2DEC5'><strong>" . ONLINES_CHARACTER . "</strong></td>\n\t\t\t\t\t\t   <td align='center' bgcolor='#E2DEC5'><strong>" . ONLINES_CONNECT_IN . "</strong></td>\n\t\t\t\t\t\t   <td align='center' bgcolor='#E2DEC5'><strong>" . ONLINES_RESETS . "</strong></td>\n\t\t\t\t\t\t   <td align='center' bgcolor='#E2DEC5'><strong>" . ONLINES_ACCOUNT_TYPE . "</strong></td>\n\t\t\t\t\t\t   <td align='center' bgcolor='#E2DEC5'><strong>" . ONLINES_SERVER . "</strong></td>\n\t\t\t\t\t\t  </tr>";
     if (empty($_GET['room']) == false && $_GET['room'] != "all") {
         $queryRoom = "AND MEMB_STAT.ServerName = '" . $_GET['room'] . "'";
     }
     $findAccountsOnlineQ = $this->query("Use " . DATABASE_ACCOUNTS . "; SELECT MEMB_STAT.memb___id, MEMB_STAT.ConnectTM, MEMB_STAT.ServerName, AccountCharacter.GameIDC, Character." . COLUMN_RESETS . " as Resets FROM " . DATABASE_ACCOUNTS . ".dbo.MEMB_STAT JOIN " . DATABASE_CHARACTERS . ".dbo.AccountCharacter ON (MEMB_STAT.memb___id = AccountCharacter.Id) JOIN " . DATABASE_CHARACTERS . ".dbo.Character ON (AccountCharacter.GameIDC = Character.Name) WHERE MEMB_STAT.ConnectStat = 1 " . $queryRoom);
     while ($findAccountsOnline = mssql_fetch_object($findAccountsOnlineQ)) {
         ++$i;
         $checkVipQ = $this->query("Use " . DATABASE . "; SELECT " . $TABLES_CONFIGS['WEBVIPS']['columnType'] . " as type FROM " . $TABLES_CONFIGS['WEBVIPS']['database'] . ".dbo." . $TABLES_CONFIGS['WEBVIPS']['table'] . " WHERE " . $TABLES_CONFIGS['WEBVIPS']['columnUsername'] . "='" . $findAccountsOnline->memb___id . "'");
         $checkVip = mssql_fetch_object($checkVipQ);
         $tempTpl .= "<tr>\n\t\t\t\t\t\t\t\t  <td align='center' bgcolor='#EDEBDC'>" . $findAccountsOnline->GameIDC . "</td>\n\t\t\t\t\t\t\t\t  <td align='center' bgcolor='#EDEBDC'>" . $findAccountsOnline->ConnectTM . "</td>\n\t\t\t\t\t\t\t\t  <td align='center' bgcolor='#EDEBDC'>" . $findAccountsOnline->Resets . "</td>\n\t\t\t\t\t\t\t\t  <td align='center' bgcolor='#EDEBDC'>" . $PANELUSER_MODULE['BUY_VIPS']['NAME_FLATS'][(int) $checkVip->type] . "</td>\n\t\t\t\t\t\t\t\t  <td align='center' bgcolor='#EDEBDC'>" . $findAccountsOnline->ServerName . "</td>\n\t\t\t\t\t\t\t\t</tr>";
     }
     $tempTpl .= "<tr><td colspan='5'><em><strong>" . ONLINES_TOTAL_ONLINE . " " . (int) $i . " </strong></em></td></tr></table>";
     $ldTpl->set("ONLINES_ROWS", $tempTpl);
 }
开发者ID:neilor,项目名称:MuSite-v2-5-x,代码行数:17,代码来源:ldonlines.class.php


示例14: __construct

 public function __construct()
 {
     global $LD_Items;
     global $tpl;
     $LD_Items->GetVaultContent();
     $LD_Items->CutSlotsVault();
     $LD_Items->CutHexSlotsVault();
     $SQL_Q = $this->query("SELECT ConnectStat FROM MEMB_STAT WHERE memb___id='" . $_SESSION['Login'] . "'");
     $SQL = mssql_fetch_object($SQL_Q);
     if ($SQL->ConnectStat != 0) {
         $tpl->set("LIST_BOX_ITENS", "<ul><li>Voc&ecirc; deve estar offline do jogo para usar essa op&ccedil;&atilde;o!</li></ul>");
         return;
     }
     if (isset($_GET['WriteVault']) == false) {
         $this->Find_Items();
     } else {
         $this->Fix_Items();
     }
     $tpl->set("LIST_BOX_ITENS", $this->ResponseItems);
 }
开发者ID:neilor,项目名称:MuShopping-v3,代码行数:20,代码来源:recover_broken_item.class.php


示例15: __construct

 public function __construct($account, $dbVersion)
 {
     try {
         global $sqlMu;
         $this->clearVars();
         if (is_numeric($dbVersion) == false) {
             throw new Exception("dbVersion must be numeric.");
         }
         if ($dbVersion < 1 || $dbVersion > 3) {
             throw new Exception("dbVersion invalid.");
         }
         $this->dbVersion = $dbVersion;
         $this->account = $account;
         if ($this->dbVersion == 3) {
             $getLenghts = $sqlMu->query("SELECT [length] FROM [syscolumns] WHERE OBJECT_NAME([id]) = 'warehouse' AND [name] = 'Items';");
             $getLenghts = mssql_fetch_object($getLenghts);
             $this->slotNumbers = $getLenghts->length * 2 / 32;
         }
     } catch (Exception $msg) {
         exit("Vault class error: " . $msg->getMessage());
     }
 }
开发者ID:ADMTec,项目名称:ldManager-MuOnline,代码行数:22,代码来源:ldVault.class.php


示例16: getVault

 public function getVault()
 {
     global $ldMssql;
     try {
         switch ($this->dbVersion) {
             case 1:
             case 2:
                 $this->itemSize = 10 * 120;
                 break;
             case 3:
                 $this->itemSize = 16 * $this->slotNumbers;
                 break;
         }
         //$getVault = $ldMssql->query("DECLARE @BINARYITEMS VARBINARY({$this->itemSize}); SELECT @BINARYITEMS = [Items] FROM [".DATABASE_ACCOUNTS."].[dbo].[warehouse] WHERE [AccountID] = '{$this->account}'; PRINT @BINARYITEMS;");
         //$this->binaryCode = substr(mssql_get_last_message($getVault),2);
         $getVault = $ldMssql->query("SELECT CONVERT(TEXT, CONVERT(VARCHAR(" . $this->itemSize . "), Items)) [Items] FROM [" . DATABASE_ACCOUNTS . "].[dbo].[warehouse] WHERE [AccountID] = '{$this->account}';");
         $getVault = mssql_fetch_object($getVault);
         $this->binaryCode = strtoupper(bin2hex($getVault->Items));
     } catch (Exception $msg) {
         exit("Vault error: " . $msg->getMessage());
     }
 }
开发者ID:neilor,项目名称:MuSite-v2-5-x,代码行数:22,代码来源:ldVault.class.php


示例17: _fetch_object

 /**
  * Result - object
  *
  * Returns the result set as an object
  *
  * @access	private
  * @return	object
  */
 function _fetch_object()
 {
     return mssql_fetch_object($this->result_id);
 }
开发者ID:jiz,项目名称:CodeIgniter,代码行数:12,代码来源:mssql_result.php


示例18: _post_query

 function _post_query($query, $dbh)
 {
     ++$this->num_queries;
     // If there is an error then take note of it..
     if ($this->result == FALSE && ($this->last_error = mssql_get_last_message())) {
         $this->log_query($this->last_error);
         //var_dump($query);
         //var_dump($this->translation_changes);
         $this->print_error();
         return false;
     }
     if (defined('SAVEQUERIES') && SAVEQUERIES) {
         $this->queries[] = array($query, $this->timer_stop(), $this->get_caller());
     }
     if (preg_match("/^\\s*(insert|delete|update|replace) /i", $query)) {
         $this->rows_affected = mssql_rows_affected($dbh);
         // Take note of the insert_id
         if (preg_match("/^\\s*(insert|replace) /i", $query)) {
             $result = @mssql_fetch_object(@mssql_query("SELECT SCOPE_IDENTITY() AS ID"));
             $this->insert_id = $result->ID;
         }
         $return_val = $this->rows_affected;
     } else {
         $i = 0;
         while ($i < @mssql_num_fields($this->result)) {
             $field = @mssql_fetch_field($this->result, $i);
             $new_field = new stdClass();
             $new_field->name = $field->name;
             $new_field->table = $field->column_source;
             $new_field->def = null;
             $new_field->max_length = $field->max_length;
             $new_field->not_null = true;
             $new_field->primary_key = null;
             $new_field->unique_key = null;
             $new_field->multiple_key = null;
             $new_field->numeric = $field->numeric;
             $new_field->blob = null;
             $new_field->type = $field->type;
             if (isset($field->unsigned)) {
                 $new_field->unsigned = $field->unsigned;
             } else {
                 $new_field->unsigned = null;
             }
             $new_field->zerofill = null;
             $this->col_info[$i] = $new_field;
             $i++;
         }
         $num_rows = 0;
         while ($row = @mssql_fetch_object($this->result)) {
             $this->last_result[$num_rows] = $row;
             $num_rows++;
         }
         $this->last_result = $this->fix_results($this->last_result);
         // perform limit
         if (!empty($this->limit)) {
             $this->last_result = array_slice($this->last_result, $this->limit['from'], $this->limit['to']);
             $num_rows = count($this->last_result);
         }
         @mssql_free_result($this->result);
         // Log number of rows the query returned
         $this->num_rows = $num_rows;
         // Return number of rows selected
         $return_val = $this->num_rows;
     }
     $this->log_query();
     return $return_val;
 }
开发者ID:developmentDM2,项目名称:Whohaha,代码行数:67,代码来源:mssql.php


示例19: fetch_object

 /**
  * Fetch a result row as an object
  *
  * @param   mixed $result
  * @return  object
  */
 function fetch_object($result)
 {
     return mssql_fetch_object($result);
 }
开发者ID:atlcurling,项目名称:tkt,代码行数:10,代码来源:Mssql.php


示例20: loadObjectList

 /**
  * Load a list of database objects
  * @param string The field name of a primary key
  * @return array If <var>key</var> is empty as sequential list of returned records.
  * If <var>key</var> is not empty then the returned array is indexed by the value
  * the database key.  Returns <var>null</var> if the query fails.
  */
 function loadObjectList($key = '')
 {
     if (!($cur = $this->query())) {
         return null;
     }
     $array = array();
     while ($row = mssql_fetch_object($cur)) {
         if ($key) {
             $array[$row->{$key}] = $row;
         } else {
             $array[] = $row;
         }
     }
     mssql_free_result($cur);
     return $array;
 }
开发者ID:Jonathonbyrd,项目名称:SportsCapping-Experts,代码行数:23,代码来源:mssql.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP mssql_fetch_row函数代码示例发布时间:2022-05-15
下一篇:
PHP mssql_fetch_field函数代码示例发布时间: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