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

        <small id='1hKFO'></small><noframes id='1hKFO'>

        <legend id='1hKFO'><style id='1hKFO'><dir id='1hKFO'><q id='1hKFO'></q></dir></style></legend>
        <tfoot id='1hKFO'></tfoot>

        • <bdo id='1hKFO'></bdo><ul id='1hKFO'></ul>

        PDO:找不到驱动程序 php/mysql

        时间:2023-10-05
          <tbody id='AXA2p'></tbody>
          <legend id='AXA2p'><style id='AXA2p'><dir id='AXA2p'><q id='AXA2p'></q></dir></style></legend>
          <i id='AXA2p'><tr id='AXA2p'><dt id='AXA2p'><q id='AXA2p'><span id='AXA2p'><b id='AXA2p'><form id='AXA2p'><ins id='AXA2p'></ins><ul id='AXA2p'></ul><sub id='AXA2p'></sub></form><legend id='AXA2p'></legend><bdo id='AXA2p'><pre id='AXA2p'><center id='AXA2p'></center></pre></bdo></b><th id='AXA2p'></th></span></q></dt></tr></i><div id='AXA2p'><tfoot id='AXA2p'></tfoot><dl id='AXA2p'><fieldset id='AXA2p'></fieldset></dl></div>

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

            1. <tfoot id='AXA2p'></tfoot>

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

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

                  问题描述

                  我在连接到我拥有的网络主机上的数据库时遇到问题,我正在使用以下内容:

                  i'm having issues connecting to my database on a web host that I have, i'm using the following:

                  $dsn = 'mysql:host=mysql1.hosting.digiweb.ie;dbname=mydbname';
                   $user = 'myusername';
                   $password = 'mypassword';
                  

                  根据网站:Host Name mysql1.hosting.digiweb.ie(ip地址)

                  According to the website: Host Name mysql1.hosting.digiweb.ie (ip address)

                  正如标题所说,我遇到了找不到驱动程序的错误,我是否错误地输入了主机,我尝试输入上面的内容以及 IP 地址 - 谢谢!

                  as the title says i'm getting a could not find driver error, am i entering the host incorrectly i tried entering whats above and also the ip address - Thanks!

                  这是我所有的代码

                  <?php
                  
                   $dsn = 'mysql:host=localhost;dbname=';
                   $user = '';
                   $password = '';
                  
                  try {
                    // Connect and create the PDO object
                   $dbh = new PDO($dsn, $user, $password);
                   $dbh->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
                  }
                  catch(PDOException $e) {
                   echo 'Database connection failed - ';
                   echo $e->getMessage();
                   exit;
                  }
                  
                  
                  echo 'works';
                  ?>
                  

                  推荐答案

                  转到你的 php.ini 文件并取消注释这一行

                  go to your php.ini file and uncomment this line

                      extension=php_pdo_mysql.dll
                  

                  然后重启你的 apache

                  and then restart your apache

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

                  上一篇:PHP PDO - 使用 MySQL 变量 下一篇:使用 PDO Prepared Statement 并递增列值

                  相关文章

                  最新文章

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

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