• <tfoot id='UqsLt'></tfoot>
      <bdo id='UqsLt'></bdo><ul id='UqsLt'></ul>
    <i id='UqsLt'><tr id='UqsLt'><dt id='UqsLt'><q id='UqsLt'><span id='UqsLt'><b id='UqsLt'><form id='UqsLt'><ins id='UqsLt'></ins><ul id='UqsLt'></ul><sub id='UqsLt'></sub></form><legend id='UqsLt'></legend><bdo id='UqsLt'><pre id='UqsLt'><center id='UqsLt'></center></pre></bdo></b><th id='UqsLt'></th></span></q></dt></tr></i><div id='UqsLt'><tfoot id='UqsLt'></tfoot><dl id='UqsLt'><fieldset id='UqsLt'></fieldset></dl></div>
  • <small id='UqsLt'></small><noframes id='UqsLt'>

      1. <legend id='UqsLt'><style id='UqsLt'><dir id='UqsLt'><q id='UqsLt'></q></dir></style></legend>
      2. MSSQL PDO 找不到驱动程序

        时间:2023-10-05
        <tfoot id='I18UC'></tfoot>

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

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

                  <tbody id='I18UC'></tbody>

                1. 本文介绍了MSSQL PDO 找不到驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我使用的是通过 XAMPP 和 Microsoft SQL Server 2008 R2 (SQLEXPRESS) 安装的 PHP 5.3.8 版.我已经正确安装了驱动程序(我猜)并在 php.ini 中添加了正确的行(确切地说是 extension=php_pdo_sqlsrv_53_ts_vc9.dll).

                  我正在尝试像这样连接到服务器:

                  尝试{$DBH = new PDO("mssql:host=xxxx;dbname=xxxx", 'xxxx', 'xxxx');} catch(PDOException $e) {echo $e->getMessage();}

                  我收到了找不到驱动程序"的错误消息,我已经对其进行了各种调整以解决该问题.我已经尝试了所有其他类型的驱动程序,但这是唯一一个 Apache 在启动时不给我错误的驱动程序.当我运行 phpinfo() 时,除了 pdo_sqlsrv.log_severity 设置为 0 之外,pdo_sqlsrv 字段都是空白的.

                  我从

                  I'm using PHP Version 5.3.8 that was installed via XAMPP along with Microsoft SQL Server 2008 R2 (SQLEXPRESS). I have the drivers installed correctly (i guess) and have added the correct line into php.ini (extension=php_pdo_sqlsrv_53_ts_vc9.dll to be exact).

                  I'm trying to connect to the server like so:

                  try {
                  
                      $DBH = new PDO("mssql:host=xxxx;dbname=xxxx", 'xxxx', 'xxxx');
                  
                  } catch(PDOException $e) {
                  
                      echo $e->getMessage();
                  }
                  

                  I get the "could not find driver" error, and I've tweaked it all kinds of ways to solve the problem. I've tried all other kinds of drivers, but this is the only one that Apache doesn't give me an error on startup. When I run phpinfo(), the pdo_sqlsrv fields are all blank except pdo_sqlsrv.log_severity which is set to 0.

                  I DL'd my drivers from microsoft, and I've tried both 2.0 and 3.0

                  Any advice would be awesome!!

                  解决方案

                  mssql is the old way of doing it, sqlsrv should be more appropriate! In fact the extension is called (extension=php_pdo_sqlsrv_53_ts_vc9.dll) as well ;)

                  try {
                  
                      $DBH = new PDO("sqlsrv:Server=xxxx;Database=xxxx", 'xxxx', 'xxxx');
                  
                  } catch (PDOException $e) {
                  
                      echo $e->getMessage();
                  }
                  

                  Hope this helps!

                  Source : http://php.net/manual/fr/ref.pdo-sqlsrv.connection.php

                  这篇关于MSSQL PDO 找不到驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:PDO 连接从命令行工作,而不是通过 Apache? 下一篇:php pdo 只从 mysql 获取一个值;等于变量的值

                  相关文章

                  最新文章

                    <bdo id='Q7qHG'></bdo><ul id='Q7qHG'></ul>
                2. <legend id='Q7qHG'><style id='Q7qHG'><dir id='Q7qHG'><q id='Q7qHG'></q></dir></style></legend>

                    <tfoot id='Q7qHG'></tfoot>

                  1. <i id='Q7qHG'><tr id='Q7qHG'><dt id='Q7qHG'><q id='Q7qHG'><span id='Q7qHG'><b id='Q7qHG'><form id='Q7qHG'><ins id='Q7qHG'></ins><ul id='Q7qHG'></ul><sub id='Q7qHG'></sub></form><legend id='Q7qHG'></legend><bdo id='Q7qHG'><pre id='Q7qHG'><center id='Q7qHG'></center></pre></bdo></b><th id='Q7qHG'></th></span></q></dt></tr></i><div id='Q7qHG'><tfoot id='Q7qHG'></tfoot><dl id='Q7qHG'><fieldset id='Q7qHG'></fieldset></dl></div>

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