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 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器