Home > Backend Development > PHP Tutorial > 新人求教php连接不上数据库有关问题

新人求教php连接不上数据库有关问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 13:43:18
Original
981 people have browsed it

新人求教php连接不上数据库问题!
代码如下

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->

<?php>

$conn=MySql_connect("localhost","root","root") or die("connect fail".MySql_error());
echo"<p>success</p>";
$ok=MySql_select_db("test",$conn);
if($ok)
{
echo "<p>数据库选择成功</p>";
}
else
{
echo "<p>选择失败</p>";
}
?>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template