Home >php教程 >php手册 >mysql数据库连接代码入门例子

mysql数据库连接代码入门例子

WBOY
WBOYOriginal
2016-05-24 18:30:59757browse

<?php
$cn = mysql_connect(&#39;localhost&#39;,&#39;root&#39;,&#39;root&#39;); 
if( $cn )
{ 
    die(&#39;数据库连接成功&#39;); 
} 
else 
{ 
    die(&#39;连接失败&#39;); 
}


教程链接:

随意转载~但请保留教程地址★

Statement:
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