[s:2]输入这段代码出现以下的错误提示:
<?php
$host="localhost";
$username="root";
$password="root";
if($connid=mysql_connect($host,$username,$password)){
echo"<script language='javascript'>alert('数据库连接成功');</script>";
}else{
echo"<script language='javascript'>alert('数据库连接失败'>;</script>";
}
?>
提示的错误
Warning: mysql_connect() [function.mysql-connect]: OK packet 6 bytes shorter than expected. PID=288 in D:\AppServ\www\asd\Untitled-1.php on line 13Warning: mysql_connect() [function.mysql-connect]: mysqlnd cannot connect to MySQL 4.1+ using old authentication in D:\AppServ\www\asd\Untitled-1.php on line 13Warning: mysql_connect() [function.mysql-connect]: in D:\AppServ\www\asd\Untitled-1.php on line 13
求解啊
<?php
$host="localhost";
$username="root";
$password="root";
if($connid=mysql_connect($host,$username,$password)){
echo"<script language='javascript'>alert('数据库连接成功');</script>";
}else{
echo"<script language='javascript'>alert('数据库连接失败'>;</script>";
}
?>
提示的错误
Warning: mysql_connect() [function.mysql-connect]: OK packet 6 bytes shorter than expected. PID=288 in D:\AppServ\www\asd\Untitled-1.php on line 13Warning: mysql_connect() [function.mysql-connect]: mysqlnd cannot connect to MySQL 4.1+ using old authentication in D:\AppServ\www\asd\Untitled-1.php on line 13Warning: mysql_connect() [function.mysql-connect]: in D:\AppServ\www\asd\Untitled-1.php on line 13
求解啊
这行的 alert('数据库连接失败'>; > 应该改成 ) 以外,没有其他问题,能执行。是不是前后还有代码?
看看这样行不行