📄 createeorder.php
字号:
<?
$connect=mysql_connect("127.0.0.1","root","root");
mysql_select_db("ebusiness");
$result=mysql_list_tables("ebusiness");
$i=0;
$flag=false;
//判定是否存在表EOrder
while($i<mysql_num_rows($result))
{
if(mysql_tablename($reslut,$i)=="EOrder" || mysql_tablename($reslut,$i)=="eorder")
{
$flag=true;
break;
}
$i++;
}
//不存在则创建之
if(!$flag)
{
$query="Creat table EOrder"
(
OrderID int not null,
ProductID int not null,
ProductName varchar(60),
Price DEC(9,2),
Quantity int not null,
Category varchar(30),
UserID int not null,
Sum DEC(9,2),
Address varchar(60),
Tel varchar(16),
IsSent char(1),
OrderDate datetime
)";
//输出成功信息
if (mysql_query($query))
echo "订单数据表建立成功!";
}
//输出表项已存在的信息
else
echo "The table EOrder already exists!";
mysql_close($connect);
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -