久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <small id='qIbek'></small><noframes id='qIbek'>

      <bdo id='qIbek'></bdo><ul id='qIbek'></ul>
    <legend id='qIbek'><style id='qIbek'><dir id='qIbek'><q id='qIbek'></q></dir></style></legend>
      1. <i id='qIbek'><tr id='qIbek'><dt id='qIbek'><q id='qIbek'><span id='qIbek'><b id='qIbek'><form id='qIbek'><ins id='qIbek'></ins><ul id='qIbek'></ul><sub id='qIbek'></sub></form><legend id='qIbek'></legend><bdo id='qIbek'><pre id='qIbek'><center id='qIbek'></center></pre></bdo></b><th id='qIbek'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='qIbek'><tfoot id='qIbek'></tfoot><dl id='qIbek'><fieldset id='qIbek'></fieldset></dl></div>

        <tfoot id='qIbek'></tfoot>

        PDO 返回錯(cuò)誤“找不到驅(qū)動(dòng)程序"使用已知的

        PDO returning error quot;could not find driverquot; with a known working DSN(PDO 返回錯(cuò)誤“找不到驅(qū)動(dòng)程序使用已知的 DSN)

        <small id='jM2Fi'></small><noframes id='jM2Fi'>

              <tfoot id='jM2Fi'></tfoot>
              <legend id='jM2Fi'><style id='jM2Fi'><dir id='jM2Fi'><q id='jM2Fi'></q></dir></style></legend>
              • <i id='jM2Fi'><tr id='jM2Fi'><dt id='jM2Fi'><q id='jM2Fi'><span id='jM2Fi'><b id='jM2Fi'><form id='jM2Fi'><ins id='jM2Fi'></ins><ul id='jM2Fi'></ul><sub id='jM2Fi'></sub></form><legend id='jM2Fi'></legend><bdo id='jM2Fi'><pre id='jM2Fi'><center id='jM2Fi'></center></pre></bdo></b><th id='jM2Fi'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='jM2Fi'><tfoot id='jM2Fi'></tfoot><dl id='jM2Fi'><fieldset id='jM2Fi'></fieldset></dl></div>
                  <bdo id='jM2Fi'></bdo><ul id='jM2Fi'></ul>
                    <tbody id='jM2Fi'></tbody>
                  本文介紹了PDO 返回錯(cuò)誤“找不到驅(qū)動(dòng)程序"使用已知的 DSN的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我正在嘗試通過(guò) php 的 PDO 類(lèi)連接到 odbc 數(shù)據(jù)庫(kù):

                  $dsn = 'odbc:CS_HDZipCodes32bit';$用戶(hù)名 = '演示';$password = 'skdemo!';$connection = new PDO($dsn, $username, $password);死( var_dump( $connection ) );

                  但是當(dāng)我這樣做時(shí),我收到錯(cuò)誤:

                  <塊引用>

                  致命錯(cuò)誤:在 C:inetpubwwwrootpdoClass.php:7 堆棧跟蹤:#0 C:inetpubwwwrootpdoClass.php(7) 中出現(xiàn)消息找不到驅(qū)動(dòng)程序"的未捕獲異常PDOException": PDO->__construct('odbc:CS_HDZipCo...', 'demo', 'skdemo!') #1 {main} 在第 7 行的 C:inetpubwwwrootpdoClass.php 中拋出

                  $dsn 值是我在 ODBC 管理器中創(chuàng)建的 DSN 的名稱(chēng).

                  我知道這個(gè)特定的 DSN 有效,因?yàn)槲夷軌驑?gòu)建另一個(gè)演示文件并通過(guò) odbc_connect 成功連接:

                  $connection = odbc_connect("CS_HDZipCodes32bit", 'demo', 'skdemo!');如果(!$連接){die('連接失敗');}$statement = "SELECT * FROM ZipCodes";$result = odbc_exec($connection, $statement);//按預(yù)期輸出拉鏈var_dump(odbc_result_all($result));

                  我一直在研究

                  看起來(lái)驅(qū)動(dòng)程序已安裝,除非這是不同的驅(qū)動(dòng)程序.

                  另一個(gè)更新

                  根據(jù) Marc B 的附加評(píng)論進(jìn)一步檢查我的 phpini,看起來(lái)我沒(méi)有安裝 POD ODBC 特定驅(qū)動(dòng)程序:

                  這里,如果我安裝了 pdo 的 ODBC 驅(qū)動(dòng)程序,odbc 將位于列表的末尾,對(duì)嗎?

                  解決方案

                  在最初問(wèn)題的評(píng)論中得到 Marc B 的大力幫助后,結(jié)果證明問(wèn)題出在我對(duì)啟用 odbc 的誤解在我的 Web 服務(wù)器上并安裝了 pdo_odbc 驅(qū)動(dòng)程序.

                  雖然我確實(shí)在 Web 服務(wù)器上啟用了 odbc,但我沒(méi)有為 PDO 安裝 odbc 驅(qū)動(dòng)程序.

                  此驅(qū)動(dòng)程序是通過(guò) pdo 訪(fǎng)問(wèn) odbc 數(shù)據(jù)庫(kù)所必需的.

                  根據(jù)關(guān)于

                  添加驅(qū)動(dòng)程序并重新啟動(dòng)服務(wù)器后,我現(xiàn)在加載了驅(qū)動(dòng)程序:

                  并且我在演示數(shù)據(jù)庫(kù)上使用 PDO 的測(cè)試查詢(xún)有效:

                  $dsn = 'odbc:CS_HDZipCodes32bit';$用戶(hù)名 = '演示';$password = 'skdemo!';$connection = new PDO($dsn, $username, $password);$query = "從郵政編碼中選擇 *";$result = $connection->query($query);foreach($result 作為 $row){var_dump($row);}

                  轉(zhuǎn)儲(chǔ):

                  感謝馬克 B 的幫助.

                  I'm trying to connect to an odbc database via php's PDO class:

                  $dsn = 'odbc:CS_HDZipCodes32bit';
                  $username = 'demo';
                  $password = 'skdemo!';
                  
                  $connection = new PDO($dsn, $username, $password);
                  
                  die( var_dump( $connection ) );
                  

                  but when I do, I get the error :

                  Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in C:inetpubwwwrootpdoClass.php:7 Stack trace: #0 C:inetpubwwwrootpdoClass.php(7): PDO->__construct('odbc:CS_HDZipCo...', 'demo', 'skdemo!') #1 {main} thrown in C:inetpubwwwrootpdoClass.php on line 7

                  The $dsn value is the name of the DSN I created in my ODBC Manager.

                  I know this particular DSN works because I was able to build another demo file and connect successfully via odbc_connect:

                  $connection = odbc_connect("CS_HDZipCodes32bit", 'demo', 'skdemo!');
                  
                  if(!$connection){
                      die('connection failed');
                  }
                  
                  $statement = "SELECT * FROM ZipCodes";
                  
                  $result = odbc_exec($connection, $statement);
                  
                  
                  // Outputs the zips as expected
                  var_dump(odbc_result_all($result));
                  

                  I've been digging through the PDO-ODBC documentation as well as other resources online, but I can't figure out why PHP is unable to find the driver when trying from PDO.

                  Any ideas?

                  Update

                  I popped open my phpinfo page to make sure the odbc driver is installed per Marc B's comment:

                  It looks like the driver is installed unless this is a different driver.

                  Another Update

                  On further inspection of my phpini per Marc B's additional comment, it looks like I don't have the POD ODBC specific driver installed:

                  So here, if I had the ODBC driver for pdo installed, odbc would be at the end of the list, correct?

                  解決方案

                  After getting some great help from Marc B in the initial question's comments it turns out the problem was coming from my misunderstanding of enabling odbc on my web server and having the pdo_odbc driver installed.

                  While I did have odbc enabled on the web server, I did not have the odbc driver installed for PDO.

                  This driver is necessary to be able to access odbc databases via pdo.

                  Per the php.net documentation on installing pdo for windows, the driver was already included in the php build (I'm using version 5.5) and just needed to be included in the php.ini file.

                  After adding the driver and restarting the server I now had the driver loaded:

                  and my test query using PDO on my demo database worked:

                  $dsn = 'odbc:CS_HDZipCodes32bit';
                  $username = 'demo';
                  $password = 'skdemo!';
                  
                  $connection = new PDO($dsn, $username, $password);
                  
                  $query = "Select * FROM ZipCodes";
                  
                  
                  $result = $connection->query($query);
                  
                  foreach($result as $row){
                      var_dump($row);
                  }
                  

                  Dumps out:

                  Thanks for your help Marc B.

                  這篇關(guān)于PDO 返回錯(cuò)誤“找不到驅(qū)動(dòng)程序"使用已知的 DSN的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  MySQLi prepared statement amp; foreach loop(MySQLi準(zhǔn)備好的語(yǔ)句amp;foreach 循環(huán))
                  Is mysqli_insert_id() gets record from whole server or from same user?(mysqli_insert_id() 是從整個(gè)服務(wù)器還是從同一用戶(hù)獲取記錄?)
                  PHP MySQLi doesn#39;t recognize login info(PHP MySQLi 無(wú)法識(shí)別登錄信息)
                  mysqli_select_db() expects exactly 2 parameters(mysqli_select_db() 需要 2 個(gè)參數(shù))
                  Php mysql pdo query: fill up variable with query result(Php mysql pdo 查詢(xún):用查詢(xún)結(jié)果填充變量)
                  MySQLI 28000/1045 Access denied for user #39;root#39;@#39;localhost#39;(MySQLI 28000/1045 用戶(hù)“root@“l(fā)ocalhost的訪(fǎng)問(wèn)被拒絕)

                  <tfoot id='AEzhT'></tfoot>
                • <small id='AEzhT'></small><noframes id='AEzhT'>

                      <tbody id='AEzhT'></tbody>
                  • <i id='AEzhT'><tr id='AEzhT'><dt id='AEzhT'><q id='AEzhT'><span id='AEzhT'><b id='AEzhT'><form id='AEzhT'><ins id='AEzhT'></ins><ul id='AEzhT'></ul><sub id='AEzhT'></sub></form><legend id='AEzhT'></legend><bdo id='AEzhT'><pre id='AEzhT'><center id='AEzhT'></center></pre></bdo></b><th id='AEzhT'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='AEzhT'><tfoot id='AEzhT'></tfoot><dl id='AEzhT'><fieldset id='AEzhT'></fieldset></dl></div>
                    • <legend id='AEzhT'><style id='AEzhT'><dir id='AEzhT'><q id='AEzhT'></q></dir></style></legend>

                          <bdo id='AEzhT'></bdo><ul id='AEzhT'></ul>

                            主站蜘蛛池模板: 欧美激情久久久 | 欧美福利专区 | 国产精品久久久久久吹潮 | 成人亚洲网 | 一级片免费网站 | 精品欧美乱码久久久久久 | 久久一区二区精品 | 69福利影院| 另类二区| 国产二区三区 | 正在播放国产精品 | 亚洲精品18 | 国产精品入口麻豆www | 亚洲成人福利视频 | 二区视频 | 色综合久久久 | 久久久久久久久久久久亚洲 | 欧美国产大片 | 国产成人久久av免费高清密臂 | 精品无码久久久久久国产 | 黄网站在线观看 | 国产激情偷乱视频一区二区三区 | 日本小电影在线 | 天天操天天插 | 久久av一区 | www.国产一区| 粉嫩粉嫩芽的虎白女18在线视频 | 国产精品久久亚洲 | 欧美精品一二区 | 羞羞免费网站 | 一区二区三区高清在线观看 | 欧美视频三区 | 精品av久久久久电影 | 中文字幕成人 | 久久久久亚洲精品 | 欧美一级欧美三级在线观看 | 一级毛片在线播放 | 草草草网站 | 羞羞的视频免费观看 | 激情毛片 | 久久国产精品一区二区三区 |