|
數(shù)據(jù)庫(kù)的結(jié)構(gòu)為:
+-----------+-------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-------------+------+-----+---------------------+----------------+
| userid | int(11) | | PRI | 0 | auto_increment |
| username | char(20) | | | | |
| sex | char(2) | | | | |
| address | char(40) | YES | | NULL | |
| ip | char(15) | | | | |
| post | int(11) | YES | | 0 | |
| oicq | int(11) | YES | | 0 | |
| icq | int(11) | YES | | 0 | |
| telnumber | char(30) | YES | | NULL | |
| comment | text | | | NULL | |
| time | datetime | | | 0000-00-00 00:00:00 | |
+-----------+-------------+------+-----+---------------------+----------------+
如果你認(rèn)為建立數(shù)據(jù)庫(kù)太麻煩的話(huà)
建立數(shù)據(jù)庫(kù)的語(yǔ)句為:
DROP DATABASE IF EXISTS pinghui;
CREATE DATABASE pinghui;
USE pinghui;
CREATE TABLE comment(
userid int NOT NULL DEFAULT 0 AUTO_INCREMENT PRIMARY KEY,
username char(20) NOT NULL,
sex char(2),
address char(40),
ip char(15) NOT NULL,
post int DEFAULT 0,
oicq int DEFAULT 0,
icq int DEFAULT 0,
telnumber char(30),
comment text NOT NULL,
time datetime NOT NULL
);
INSERT INTO comment (username,ip,comment,time) VALUES ("pinghui","127.0.0.1",
"你好,請(qǐng)到萍慧自由空間查看信息!",now());
insert into comment (username,sex,address,ip,post,oicq,icq,telnumber,comment,time)
values ('pinghui','男','地址','127.0.0.1',250100,2269101,74875874,'0531-8605449',
'你好,請(qǐng)到萍慧自由空間查看留言!謝謝!',now());
有了數(shù)據(jù)庫(kù)下面我們的講解會(huì)更方便的。 繼續(xù)留言本的建立
jsp技術(shù):如何使用JSP+MySQL創(chuàng)建留言本(一),轉(zhuǎn)載需保留來(lái)源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。