mysql在PHP中创建表的时候。如何用变量。
$abc='$_POST[textfield]';$con=mysql_connect("localhost","root","");mysql_query("CREAT...
$abc='$_POST[textfield]';
$con = mysql_connect("localhost","root","");
mysql_query("CREATE DATABASE my",$con);
mysql_select_db("my", $con);
$sql = "CREATE TABLE $abc
(
id BIGINT PRIMARY KEY NOT NULL AUTO_INCREMENT,
zhonglei varchar(15) character set utf8,
)";
mysql_query($sql,$con);
mysql_query("set names utf8");
textfield为变量输入的文本框
想通过输入内容成功表的名字。 展开
$con = mysql_connect("localhost","root","");
mysql_query("CREATE DATABASE my",$con);
mysql_select_db("my", $con);
$sql = "CREATE TABLE $abc
(
id BIGINT PRIMARY KEY NOT NULL AUTO_INCREMENT,
zhonglei varchar(15) character set utf8,
)";
mysql_query($sql,$con);
mysql_query("set names utf8");
textfield为变量输入的文本框
想通过输入内容成功表的名字。 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询