dsc80135 2017-05-01 23:22
浏览 169

如何连接到phpmyadmin数据库?

I'm trying to connect to a database in phpmyadmin. I'm new to the process and unsure how to connect to it.I'm using godaddy to host. I have this line of code:

$db = mysqli_connect("https://.....secureserver.net", "...", "....", "authenticationdb_");

I went to the table on phpmyadmin and copied the url, then copied the username (the first "...") and password (the second "...") that I used to login in to godaddy, and the name of the database is authenticationdb_.

This is not working and I'm not sure why. I was unsure if the username and password were the ones that I used to login in to godaddy but I don't know what else they would be since i accessed phpmyadmin thru godaddy.

  • 写回答

1条回答 默认 最新

  • douzhengyi5022 2017-05-05 06:54
    关注
    <?php
    $servername = "localhost";
    $username = "username";  //your user name for php my admin if in local most probaly it will be "root"
    $password = "";  //password probably it will be empty
    $databasename = ""; //Your db nane
    // Create connection
    $conn = new mysqli($servername, $username, $password,$databasename);
    // Check connection
    if ($conn->connect_error) {
        die("Connection failed: " . $conn->connect_error);
    } 
    echo "Connected successfully";
    ?>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥50 汇编语言除法溢出问题
  • ¥65 C++实现删除N个数据列表共有的元素
  • ¥15 Visual Studio问题
  • ¥15 state显示变量是字符串形式,但是仍然红色,无法引用,并显示类型不匹配
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波