用PHP创建数据库表总是失败,代码如下,跪求大神。。。
<?php$con=mysql_connect("localhost","root","xxh2011010015");if(!$con){die('Couldnotco...
<?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("数据库选择失败<br>");
$sql = "CREATE TABLE User
(
usrname varchar(15),
password varchar(15),
mail varchar(15)
)";
mysql_query($sql,$con) or die("表User创建失败");
mysql_close($con);
?> 展开
$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("数据库选择失败<br>");
$sql = "CREATE TABLE User
(
usrname varchar(15),
password varchar(15),
mail varchar(15)
)";
mysql_query($sql,$con) or die("表User创建失败");
mysql_close($con);
?> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询