这个代码有问题吗? 为什么老是创建不了数据库表?
7b1f6701a0549a297c55187f0368bfb5
<br />$con = mysql_connect("localhost","root","") or die("连接错误");<br /> $ab = mysql_select_db("my_db", $con);<br /> if($ab){<br /> echo "成功了";<br /> }<br /> $sql = "CREATE TABLE `test` (<br /> `id` int(10) NOT NULL auto_increment,<br /> `uid` varchar(10) NOT NULL default '0',<br /> `regdate` date NOT NULL,<br /> `remark` text,<br /> PRIMARY KEY (`id`)<br /> ) ENGINE=InnoDB DEFAULT CHARSET=gbk AUTO_INCREMENT=1 ;<br /> $abc = mysql_query($sql,$con);<br /> if($abc){<br /> echo "建立成功";<br /> }else {<br /> echo "失败了";<br /> }<br />$sql1="INSERT INTO `test` (`id`, `uid`, `regdate`, `remark`) VALUES<br /> (1, '张三', '2008-07-02', '学生')"<br />$result=mysql_query($sql1);<br />if($result){<br /> echo "插入数据成功";<br />}<br /><br /><br />