create table tbl_member (
userid varchar(50) not null,
userpw varchar(50) not null,
username varchar(50) not null,
email varchar(100),
regdate timestamp default now(),
updatedate timestamp default now(),
primary key(userid)
);
create table tbl_board (
bno INT NOT NULL AUTO_INCREMENT,
title VARCHAR(200) NOT NULL,
content TEXT NULL,
writer VARCHAR(50) NOT NULL,
regdate TIMESTAMP NOT NULL DEFAULT now(),
viewcnt INT DEFAULT 0,
PRIMARY KEY(bno));
XML파일의
CDATA
XML 코드 중 XML parser에 의해 해석하지 말고 그대로 브라우저에 출력하라는 뜻..
"&",">","<" 과 같은 특수문자를 쓰고 싶은데
XML parser가 태그로 인식하는 것을 방지하기 위해서,
이 것(위의 ... 부분)은 태그가 아니고 그냥 String이다!
create table tbl_reply (
rno int NOT NULL AUTO_INCREMENT,
bno int not null default 0,
replytext varchar(1000) not null,
replyer varchar(50) not null,
regdate TIMESTAMP NOT NULL default now(),
updatedate TIMESTAMP NOT NULL default now(),
primary key(rno)
);
alter table tbl_reply add constraint fk_board
foreign key (bno) references tbl_board (bno);
create table tbl_user(
uid varchar(50) not null,
upw varchar(50) not null,
uname varchar(100) not null,
upoint int not null default 0,
primary key(uid)
);
create table tbl_message (
mid int not null auto_increment,
targetid varchar(50) not null,
sender varchar(50) not null,
message text not null,
opendate timestamp,
senddate timestamp not null default now(),
primary key(mid)
);
alter table tbl_message add constraint fk_usertarget
foreign key (targetid) references tbl_user (uid);
alter table tbl_message add constraint fk_usersender
foreign key (targetid) references tbl_user (uid);
insert into tbl_user(uid, upw, uname) values ('user00', 'user00', 'IRON MAN');
insert into tbl_user(uid, upw, uname) values ('user01', 'user01', 'CAPTAIN');
insert into tbl_user(uid, upw, uname) values ('user02', 'user02', 'HULK');
insert into tbl_user(uid, upw, uname) values ('user03', 'user03', 'THOR');
insert into tbl_user(uid, upw, uname) values ('user10', 'user10', 'QUICK SILVER');