📄 19-create.php
字号:
<?php
$host="localhost";
$user="root";
$password="";
$db="test";
$chat_t="chat_t";
$user_t="user_t";
$online_t="online_t";
$my_conn=mysql_connect($host,$user,$password);
mysql_select_db($db,$my_conn);
$sql="CREATE TABLE $chat_t
(
id int(5) not null primary key auto_increment,
nick varchar(10) not null default '',
words varchar(150) not null default '',
face varchar(20) not null default '',
receive varchar(10) not null default '',
time varchar(20) not null default ''
)";
$result=mysql_query($sql,$my_conn);
if($result)
{
echo $chat_t."表创建成功!";
}
echo "<p>";
$sql="CREATE TABLE $user_t
(
nick varchar(10) not null default '',
pass varchar(10) not null default ''
)";
$result=mysql_query($sql,$my_conn);
if($result)
{
echo $user_t."表创建成功!";
}
echo "<p>";
$sql="CREATE TABLE $online_t
(
nick varchar(10) not null default ''
)";
$result=mysql_query($sql,$my_conn);
if($result)
{
echo $online_t."表创建成功!";
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -