create table about(
content text
)engine=myisam default charset=utf8;
项目的各个建表语句
create database day456 default charset utf8;
create table user(
)engine=myisam default charset=utf8;
select * from stu;
use day456;
drop table user;
use day456;
select * from user;
truncate user;
use hnscdb;
select * from hnsc_guestbook;
drop table hnsc_guestbook;
create table hnsc_guestbook(
id int unsigned auto_increment,
gname varchar(50),
content text,
gsex varchar(5),
gtell varchar(20),
gphpne varchar(20),
gadress varchar(50),
gmail varchar(50),
gtime int,
gip varchar(15),
gflag enum('y','n') default 'n',
primary key(id)
)engine=myisam default charset=utf8;
create table hnsc_zz(
id int unsigned auto_increment,
ztitle varchar(200),
url varchar(200),
cname varchar(50),
flag enum('y','n') default 'y',
primary key(id),
constraint fk foreign key (cname) references hnsc_zzclass(cname) on delete set null on update cascade
)engine=innodb default charset=utf8;
use hnscdb;
select * from hnsc_zz;
drop table hnsc_zz;
truncate hnsc_zz;
create table hnsc_zzclass(
cname varchar(50),
primary key(cname)
)engine=innodb default charset=utf8;
create table hnsc_zz(
id smallint unsigned auto_increment,
title varchar(50),
url varchar(200),
cname varchar(50),
flag enum('y','n') default 'y',
primary key(id),
constraint fk foreign key (cname) references hnsc_zzclass(cname) on delete set null on update cascade
)engine=innodb default charset=utf8;
select * from hnsc_zzclass;
select * from hnsc_zz;
truncate hnsc_zz;
create table hnsc_newsclass(
cname varchar(50),
primary key(cname)
)engine=innodb default charset=utf8;
create table hnsc_news(
id smallint unsigned auto_increment,
title varchar(50),
content text,
author varchar(200),
num int unsigned default 0,
ntime int unsigned,
cname varchar(50),
flag enum('y','n') default 'y',
primary key(id),
constraint nfk foreign key (cname) references hnsc_newsclass(cname) on delete set null on update cascade
)engine=innodb default charset=utf8;
drop table hnsc_news;
select * from hnsc_newsclass;
truncate hnsc_news;
use hnscdb;
select * from hnsc_link;
drop table hnsc_pro;
create table hnsc_pro(
id smallint unsigned auto_increment,
title varchar(50),
img varchar(200),
content text,
num int unsigned default 0,
ntime int unsigned,
flag enum('y','n')default 'n',
jflag enum('y','n')default 'y',
primary key(id)
)engine=myisam default charset=utf8;
select * from hnsc_pro;
truncate hnsc_pro;
insert into hnsc_pro(content) values('你好');
insert into hnsc_pro(title,ntime,flag,jflag,content) values('aa',545,'y','n','第三方');
insert into hnsc_pro(title,ntime,flag,jflag,content,img) values('aa','10','y','n','你好','ds.jpg');
use hnscdb;
create table hnsc_user(
account varchar(50) primary key,
pwd varchar(50), -- 密码
truename varchar(50),-- 真是姓名
face varchar(200), -- 注册时上传的头像
why varchar(100), -- 注册时设置的问题
ok varchar(100), -- 设置的问题的答案
rip varchar(15),
regtime int unsigned-- 注册的时间
)engine=myisam default charset=utf8;
use hnscdb;
select * from hnsc_user;
drop table hnsc_user;
-- 日志管理表
create table hnsc_userlog(
id smallint unsigned auto_increment,
account varchar(50), -- 账户
alog varchar(30), -- 用户的日志操作的内容
aip varchar(15), -- 登录的ip
atime int unsigned, -- 登录的时间
primary key(id)
)engine=myisam default charset=utf8;
-- 上一篇
select id from hnsc_news where cname in(
select cname from hnsc_news where id=3)and id>3 limit 1;
-- 下一篇
select id from hnsc_news where cname in(
select cname from hnsc_news where id=5)and id<5 order by id desc limit 1;
select * from hnsc_news;
create table about(
content text
)engine=myisam default charset=utf8;
select * from about;
drop table about;
truncate table about;
<h1 class="newschptit" style="margin: 0px; padding: 0px; border: 0px; width: 700px; text-align: cent