| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 489 人关注过本帖
标题:看看这个程序到底哪有问题总提示总查询值的数目与目标字段中的数目不同
只看楼主 加入收藏
ldw8477
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-6-5
收藏
 问题点数:0 回复次数:0 
看看这个程序到底哪有问题总提示总查询值的数目与目标字段中的数目不同

程序代码如下:

<html>
<title>信息</title>
<body>
<font size="5">
<b><i>交换地带</i></b></font>
<form action="Jsp3.jsp">
<input type="submit" value="回留言板"> <br>
</form>
<hr>
<form action="savenote.jsp" action="get">
<table>
<tr><td>留言人</td>
<td><input type="text" size="20" name="name"></td>
</tr>
<tr><td valign="top" >信息</td>
<td><textarea name="note" row="5" cols="60"></textarea></td>
</tr>
<tr><td colspan="2">
<input type="submit" value="发送">
<input type="reset" value="取消"></td>
</tr>
</table>
</form>
</body>
</html>

<%@page contentType = "text/html;charset=GB2312"
import = "java.sql.*"
%>
<%!
String newline(String str)
{
int index=0;
while((index=str.indexOf("\n"))!=-1)
str=str.substring(0,index)+"<br>"+str.substring(index+1);
return(str);
}
%>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:msg");
Statement smt = con.createStatement();
String name = new String(request.getParameter("name").getBytes("ISO-8859-1"));
String note = new String(request.getParameter("note").getBytes("ISO-8859-1"));
note = newline(note);
String sql;
sql="insert into message(留言人,信息) values (‘"+name+"’,‘"+note+"’)";
smt.execute(sql);
con.close();
response.sendRedirect("Jsp3.jsp");
%>
我数据库 有自动编号 留言人 信息 时间4项 时间自动生成
但我运行 总查询值的数目与目标字段中的数目不同
希望大家帮我看下 怎么回事

搜索更多相关主题的帖子: 字段 目标 提示 查询 
2007-06-10 17:21
快速回复:看看这个程序到底哪有问题总提示总查询值的数目与目标字段中的数目不同 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014075 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved