mysql中die函数的问题$con = mysql_pconnect("59.151.12.43","kxt_db_users","userfor1234%")or die("Could not connect:" .mysql_error());后半句中的die函数每个参数啥意思,中间的英文句号干吗用的.他的返回值是什么.or前面
来源:学生作业帮助网 编辑:六六作业网 时间:2025/02/07 04:12:55
mysql中die函数的问题$con = mysql_pconnect("59.151.12.43","kxt_db_users","userfor1234%")or die("Could not connect:" .mysql_error());后半句中的die函数每个参数啥意思,中间的英文句号干吗用的.他的返回值是什么.or前面
mysql中die函数的问题
$con = mysql_pconnect("59.151.12.43","kxt_db_users","userfor1234%")
or die("Could not connect:" .mysql_error());
后半句中的die函数每个参数啥意思,中间的英文句号干吗用的.他的返回值是什么.
or前面的pconnect函数我知道.
mysql中die函数的问题$con = mysql_pconnect("59.151.12.43","kxt_db_users","userfor1234%")or die("Could not connect:" .mysql_error());后半句中的die函数每个参数啥意思,中间的英文句号干吗用的.他的返回值是什么.or前面
$con = mysql_pconnect("59.151.12.43","kxt_db_users","userfor1234%")
or die("Could not connect:" .mysql_error());
这句话的意思是连接mysql,如果连接失败,就中止后面代码的运行并给出相应的错误信息.
die()里面就一个参数,就是输出的字符串,英文逗号是连接两个字符串的,"Could not connect"和mysql_error().mysql_error()返回mysql的错误信息.
$errMsg="Could not connect:" .mysql_error();
$con = mysql_pconnect("59.151.12.43","kxt_db_users","userfor1234%") or die($errMsg);
这样是不是清楚一点?