主题:菜鸟求助!INSERT问题.还有个连接数据库的问题.!!
<!--#include file="connbbs.asp"-->
<!--#include file="../include/conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<%
userid= request("userid")
sql = "select icon,name from member where id="& userid
set rs = conn.execute(sql)
If Not rs.eof then
username = rs("name")
user_icon = rs("icon")
End If
rs.close()
cat_id = 1
cat_2 = request.form("cat_2")
title = request.form("title")
body = request.form("news_content")
layer = 1
parent_id = 0
child = 0
hit = 0
response.write username
response.write user_icon
Select Case Request("action")
Case "add"
sqlstr = "insert into forum(title,layer,parent_id,child,hit,user_name,user_icon,cat_id,cat_2,body) values('"& title &"',"& layer &","& parent_id &","& child &","& hit &",'"& username &"','"& user_icon &"',"& cat_id &","& cat_2 &",'"& body &"')"
db.execute sqlstr
end select
sqls = "select * from forum where layer = 1"
set rs = db.execute(sqls)
if not rs.eof then
response.write rs("bbs_id")
response.write rs("layer")
end if
rs.close()
%>
运行时没有显示出错,结果如下
Dika/member_icon/b/c/4/144226_20080404193057.jpg
[color=FF0000]但没有把数据写进数据库表里[/color]....不知哪里出错了..请高手赐教
本人刚学ASP.不太懂
我想问问能不能同时打开2个数据库
上面程序调用了2个数据库文件.可以这样的吗????
<!--#include file="connbbs.asp"-->
<!--#include file="../include/conn.asp"-->
像这样.
快疯了..求高手赐教
<!--#include file="../include/conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<%
userid= request("userid")
sql = "select icon,name from member where id="& userid
set rs = conn.execute(sql)
If Not rs.eof then
username = rs("name")
user_icon = rs("icon")
End If
rs.close()
cat_id = 1
cat_2 = request.form("cat_2")
title = request.form("title")
body = request.form("news_content")
layer = 1
parent_id = 0
child = 0
hit = 0
response.write username
response.write user_icon
Select Case Request("action")
Case "add"
sqlstr = "insert into forum(title,layer,parent_id,child,hit,user_name,user_icon,cat_id,cat_2,body) values('"& title &"',"& layer &","& parent_id &","& child &","& hit &",'"& username &"','"& user_icon &"',"& cat_id &","& cat_2 &",'"& body &"')"
db.execute sqlstr
end select
sqls = "select * from forum where layer = 1"
set rs = db.execute(sqls)
if not rs.eof then
response.write rs("bbs_id")
response.write rs("layer")
end if
rs.close()
%>
运行时没有显示出错,结果如下
Dika/member_icon/b/c/4/144226_20080404193057.jpg
[color=FF0000]但没有把数据写进数据库表里[/color]....不知哪里出错了..请高手赐教
本人刚学ASP.不太懂
我想问问能不能同时打开2个数据库
上面程序调用了2个数据库文件.可以这样的吗????
<!--#include file="connbbs.asp"-->
<!--#include file="../include/conn.asp"-->
像这样.
快疯了..求高手赐教