Home  >  Article  >  Backend Development  >  php-用PHP创建数据库表总是失败,代码如下,跪求大神。。

php-用PHP创建数据库表总是失败,代码如下,跪求大神。。

WBOY
WBOYOriginal
2016-06-02 11:32:441472browse

代码php

$con = mysql_connect("localhost","root","xxh2011010015");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

// Create table in my_db database
mysql_select_db("my_db", $con) or die("数据库选择失败
");
$sql = "CREATE TABLE User
(
usrname varchar(15),
password varchar(15),
mail varchar(15)
)";
mysql_query($sql,$con) or die("表User创建失败");

mysql_close($con);
?>

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