php创建数据库

作者:fly 发布于:2014-2-1 17:32 分类:discuz

<?php  
$con = mysql_connect("localhost","root","111");  
if (!$con)  
  {  
     die('Could not connect: ' . mysql_error());  
  }  
  
 if (mysql_query("CREATE DATABASE liyongquan_db",$con))  
  {  
     echo "数据库创建成功!";  
  }  
else  
  {  
     echo "数据库创建失败: " . mysql_error();  
  }  
  
mysql_close($con);  
?>  

发表评论:

 
Powered by emlog sitemap