Fatal error: Call to undefined function mysql_connect() in E:\Apache\htdocs\01\hello.php on line 2 5
无论是输入创建数据库:<?php$con=mysql_connect("localhost","root","123456");if(!$con){die(*Couldn...
无论是输入创建数据库:
<?php
$con = mysql_connect("localhost","root","123456");
if (!$con)
{
die(*Could not connect: * . mysql_error());
}
if (mysql_query("CREATE DATABASE my_db",$con))
{
echo "Database created";
}
else
{
echo "Error creating database: " . mysql_error();
}
mysql_close($con);
?>
还是添加表,都是同一个结果:
Fatal error: Call to undefined function mysql_connect() in E:\Apache\htdocs\01\hello.php on line 2
数据库的用户名和密码是正确的。
请问该怎么修改? 展开
<?php
$con = mysql_connect("localhost","root","123456");
if (!$con)
{
die(*Could not connect: * . mysql_error());
}
if (mysql_query("CREATE DATABASE my_db",$con))
{
echo "Database created";
}
else
{
echo "Error creating database: " . mysql_error();
}
mysql_close($con);
?>
还是添加表,都是同一个结果:
Fatal error: Call to undefined function mysql_connect() in E:\Apache\htdocs\01\hello.php on line 2
数据库的用户名和密码是正确的。
请问该怎么修改? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询