欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

如何使用JSP+MySQL創(chuàng)建留言本(一)

 更新時(shí)間:2006年10月13日 00:00:00   作者:  
說(shuō)明:用JSP+MySQL數(shù)據(jù)庫(kù)創(chuàng)建留言本,首先要?jiǎng)?chuàng)建MySQL數(shù)據(jù)庫(kù),關(guān)于MySQL的使用請(qǐng)到 http://pinghui.51.net/download/012mysql.chm 下載教程?,F(xiàn)在為了說(shuō)明的需要,我們假設(shè)數(shù)據(jù)庫(kù)已經(jīng)建立完成,數(shù)據(jù)庫(kù)的名稱是pinghui,其中有comment表是記錄留言信息的。

數(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ù)太麻煩的話
建立數(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ù)留言本的建立

相關(guān)文章

最新評(píng)論