选择显示字体大小

如何使用jsp+mysql创建留言本(一)


  说明:用jsp+mysql数据库创建留言本,首先要创建mysql数据库,关于mysql的使用请到 http://pinghui.51.net/download/012mysql.chm 下载教程。现在为了说明的需要,我们假设数据库已经建立完成,数据库的名称是pinghui,其中有comment表是记录留言信息的。

数据库的结构为:
+-----------+-------------+------+-----+---------------------+----------------+
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         
+-----------+-------------+------+-----+---------------------+----------------+

如果你认为建立数据库太麻烦的话
建立数据库的语句为:
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",
  "你好,请到萍慧自由空间查看信息!",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',
  '你好,请到萍慧自由空间查看留言!谢谢!',now());
有了数据库下面我们的讲解会更方便的。 继续留言本的建立


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons