PHP警告错误 [英] PHP warning error
问题描述
我正在一个项目上,该项目需要我将数据发送到网站,该网站进一步将数据发送到要登录的数据库中.我在网站的日志目录中不断收到此错误:PHP警告:mysqli_connect():(HY000/9002):您尝试的服务器名称 找不到.请使用正确的名称,然后重试.请检查您的服务器名称水质
I am working on a project that requires me to send data to a website which further sends the data to be logged into a database. I keep getting this error in the log directory of website : PHP Warning: mysqli_connect(): (HY000/9002): The server name you tried cannot be found. Please use the correct name and retry. Please check your server name waterquality
这是代码-
<?php//用于存储用于访问数据库的凭据的外部文件
<?php //An external file for storing the credentials for accessing database
$ username ="pranjal @ waterquality";
$username = "pranjal@waterquality";
$ password ="--------" ;;
$password = "--------";
$ database =水质";
$database = "waterquality";
$ 服务器 =" http:// waterquality.database.windows.net ";
///在此处插入您的凭据/*警告:确定之后没有空行吗? SIGN */?>
//Insert your credentials here /*WARNING: MAKE SURE NO EMPTY LINE IS AROUND AFTER ?> SIGN*/ ?>
推荐答案
<?php
host ='mydemoserver.mysql.database.azure.com';host = 'mydemoserver.mysql.database.azure.com';
用户名= 'myadmin @ mydemoserver';username = 'myadmin@mydemoserver';
这篇关于PHP警告错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!