dongmou3615 2015-11-30 23:32
浏览 19
已采纳

新的SQL连接未出现在LocalHost中

I'm trying to make a new connection to mysqladmin, but for reason's I cannot figure out, it will not work. From what I can see I have everything correct. Can someone please take a look and see what I am doing wrong?

Firstly, the User: PHPmyadmin

and then my sql: my sql

finally the localhost, the file is saved in a folder in the www folder of wamp so I have no idea why it is not showing. It is just blank.

Help is greatly appreciated. Thank u very much in advance.

  • 写回答

1条回答 默认 最新

  • doulei8861 2015-11-30 23:40
    关注

    You're not telling your php script what to do if the MySQL connection is successful, thats why output is blank.

    Also, i suggest you using mysqli object

    <?php
        // Create connection
        $conn = new mysqli('localhost', 'Desino', 'password');
    
        // Check connection
        if ($conn->connect_error) {
            die('Cannot connect: ' . $conn->connect_error);
        } 
        echo 'Connected successfully';
        $conn->close();
    ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 MATLAB中streamslice问题
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 51单片机中C语言怎么做到下面类似的功能的函数(相关搜索:c语言)
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序