Home  >  Q&A  >  body text

怎么才能连上我本地的数据库,他连的这个数据库哪来的?

素颜素颜2882 days ago1120

reply all(3)I'll reply

  • 钟毅

    钟毅2017-10-04 14:35:36

    Generally speaking, this file is found in CONFIG.inc.php of the website, which is the global database configuration file. In the CONFIG directory in the root directory, this file stores the connection file mentioned on the first floor. THINKPHP is generally placed in the COMMON file directory. The file content is an array.

    reply
    0
  • 数据分析师

    数据分析师2017-09-30 23:10:27

    How can I connect to my local database? Where did the database he connected to come from? -PHP Chinese website Q&A-How can I connect to my local database? Where did the database he connected to come from? -PHP Chinese website Q&A

    Please watch and learn.

    reply
    0
  • 迷茫

    迷茫2016-12-20 14:23:17

    用连接Mysqli的方法试试。

    //创建对象并打开连接,最后一个参数是选择的数据库名称

    $mysqli = new mysqli('localhost','root','','volunteer');

    //检查连接是否成功

    if (mysqli_connect_errno()){//注意mysqli_connect_error()新特性

    die('Unable to connect!'). mysqli_connect_error();

    }


    reply
    1
  • Cancelreply