mysqli_connect(): (HY000/2003): Can't connect to MySQL server on 'domain name' (111)

后端 未结 1 614
耶瑟儿~
耶瑟儿~ 2020-12-22 01:09

Im very new to php and my SQL, and am having trouble connecting to my SQL Database. Im getting the following error when i submit my HTML Form.

mysqli_connect         


        
相关标签:
1条回答
  • 2020-12-22 01:26

    It looks like your script is trying to connect "domain_name", but it can't find that server because it's not listed on the DNS's. Is your server on the same machine? In that cause you need to replace domain_name with localhost, 127.0.0.1 or the ip of the server.

    ALSO MAKE SURE TO SANITIZE YOUR INPUTS BEFORE YOU RUN THE SQL COMMANDS!!!!

    This should help.

    0 讨论(0)
提交回复
热议问题