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

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

WBOY
Release: 2016-05-24 18:30:59
Original
759 people have browsed it

<?php
$cn = mysql_connect(&#39;localhost&#39;,&#39;root&#39;,&#39;root&#39;); 
if( $cn )
{ 
    die(&#39;数据库连接成功&#39;); 
} 
else 
{ 
    die(&#39;连接失败&#39;); 
}
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template