asp问题,请求帮助,急。。。。。
2005-05-31 08:30
246 查看
就是交友网站,看一般的交友网站都会有加把会员加为好友,设黑名单这种的,我的问题是通过调用了一个存储过程,获得了想加好友的那个的id号,怎么才能把调用的id号存到数据库里呀
<a href="addfirend.asp?idh=<%=rs1("userid")%>">加为好友</a>
这个是z1.asp
<!--#include file="ADOVBS.INC"-->
<!--#include file=conn1.asp-->
<%
idhm=request("idh")
dim rs1
dim strsql
set rs1=server.CreateObject("ADODB.recordset")
strsql="exec proc_GetUserinfo1 '"+idhm+"'"
rs1.open strsql,conn1,1,3
'while not rs1.eof
firendid=idhm
response.write firendid
rs1.addnew
rs1("firendid")=firendid
%>
这是web_addfirend存储过程
/*
添加好友
*/
CREATE PROCEDURE web_Addfirend
@userID char(6),
@firendID char(6)
AS
declare @xh as int
declare @mark as int
select @xh=xh from web_firendinfo where userid=@userid and firendid=@firendid
if @@rowcount=1
begin
if @mark=1 return
if @mark=0 update web_firendinfo set mark=1 where xh=@xh
return
end
insert into web_firendinfo (userid,firendid) values(@userid,@firendid)
GO
这是调用的文件addfirend.asp
<!--#include file=conn1.asp-->
<!--#include file=z1.asp-->
<%
userid=request.Cookies("userid")
hyid1=request("hyid1")
set rs1=server.CreateObject("adodb.recordset")
rs1.Open "exec web_Addfirend '"+userid+"','"+firendid1+"'",conn1
%>
这个是获取id的存储过程,也许是这个过程的问题,可以改改~~~
CREATE PROCEDURE proc_GetUserInfo1
@userID char(6)
AS
declare @dh char(12)
declare @hjbh char(5)
declare @id char(13)
declare @name varchar(30)
declare @sex as int ---1--man 2--fenman
declare @age as int
declare @high as int --身高
declare @nickname varchar(20) --昵称
declare @knowlege as int --学历
declare @love varchar(100) --爱好
declare @occupation int --职业
declare @marrayhistory as int
declare @photopath varchar(200)
declare @type as int
declare @con_high as int
declare @con_age as int
declare @con_knowledge as int
declare @secrecylevel as int
declare @sheng varchar(30)
declare @shi varchar(30)
declare @temp varchar(20)
declare @path varchar(200)
set @temp=ltrim(rtrim(@hjbh))+ltrim(rtrim(@id))
select @name=uname,@nickname=nickname,@sex=sex,@age=age,@high=high,@type = memlevel
,@knowlege=knowledge,@love=love,@occupation=occupation,@marrayhistory=marryhistory
,@photopath=photopath,@con_high=con_high,@con_age=con_age,@con_knowledge=con_knowledge
,@secrecyLevel =secrecyLevel,@sheng = sheng,@shi=shi,@temp=code ,@dh=telnumber,@path=path
from base_userinfo where userId=@userID and (mark=1 or mark=0)
if @@rowcount=1
begin
select @name as xm,@nickname as nc,@sex xb,@age nl,@high sg,@knowlege xl,@love ah,@occupation zy,@marrayhistory hs,
@photopath zp,@con_high tsg,@con_age tnl,@con_knowledge txl,@secrecyLevel aqjb,@type jb,@sheng sheng,@shi shi,@temp code,@dh dh,@path path
end
GO
大家有没有别的方法可以取id,然后加到数据库中,在asp中我用的是sql数据库,用的是存储过程,别的方法也可以,谢谢大家了,非常急!!
<a href="addfirend.asp?idh=<%=rs1("userid")%>">加为好友</a>
这个是z1.asp
<!--#include file="ADOVBS.INC"-->
<!--#include file=conn1.asp-->
<%
idhm=request("idh")
dim rs1
dim strsql
set rs1=server.CreateObject("ADODB.recordset")
strsql="exec proc_GetUserinfo1 '"+idhm+"'"
rs1.open strsql,conn1,1,3
'while not rs1.eof
firendid=idhm
response.write firendid
rs1.addnew
rs1("firendid")=firendid
%>
这是web_addfirend存储过程
/*
添加好友
*/
CREATE PROCEDURE web_Addfirend
@userID char(6),
@firendID char(6)
AS
declare @xh as int
declare @mark as int
select @xh=xh from web_firendinfo where userid=@userid and firendid=@firendid
if @@rowcount=1
begin
if @mark=1 return
if @mark=0 update web_firendinfo set mark=1 where xh=@xh
return
end
insert into web_firendinfo (userid,firendid) values(@userid,@firendid)
GO
这是调用的文件addfirend.asp
<!--#include file=conn1.asp-->
<!--#include file=z1.asp-->
<%
userid=request.Cookies("userid")
hyid1=request("hyid1")
set rs1=server.CreateObject("adodb.recordset")
rs1.Open "exec web_Addfirend '"+userid+"','"+firendid1+"'",conn1
%>
这个是获取id的存储过程,也许是这个过程的问题,可以改改~~~
CREATE PROCEDURE proc_GetUserInfo1
@userID char(6)
AS
declare @dh char(12)
declare @hjbh char(5)
declare @id char(13)
declare @name varchar(30)
declare @sex as int ---1--man 2--fenman
declare @age as int
declare @high as int --身高
declare @nickname varchar(20) --昵称
declare @knowlege as int --学历
declare @love varchar(100) --爱好
declare @occupation int --职业
declare @marrayhistory as int
declare @photopath varchar(200)
declare @type as int
declare @con_high as int
declare @con_age as int
declare @con_knowledge as int
declare @secrecylevel as int
declare @sheng varchar(30)
declare @shi varchar(30)
declare @temp varchar(20)
declare @path varchar(200)
set @temp=ltrim(rtrim(@hjbh))+ltrim(rtrim(@id))
select @name=uname,@nickname=nickname,@sex=sex,@age=age,@high=high,@type = memlevel
,@knowlege=knowledge,@love=love,@occupation=occupation,@marrayhistory=marryhistory
,@photopath=photopath,@con_high=con_high,@con_age=con_age,@con_knowledge=con_knowledge
,@secrecyLevel =secrecyLevel,@sheng = sheng,@shi=shi,@temp=code ,@dh=telnumber,@path=path
from base_userinfo where userId=@userID and (mark=1 or mark=0)
if @@rowcount=1
begin
select @name as xm,@nickname as nc,@sex xb,@age nl,@high sg,@knowlege xl,@love ah,@occupation zy,@marrayhistory hs,
@photopath zp,@con_high tsg,@con_age tnl,@con_knowledge txl,@secrecyLevel aqjb,@type jb,@sheng sheng,@shi shi,@temp code,@dh dh,@path path
end
GO
大家有没有别的方法可以取id,然后加到数据库中,在asp中我用的是sql数据库,用的是存储过程,别的方法也可以,谢谢大家了,非常急!!
相关文章推荐
- asp.net web api 解决ajax跨站点post请求提交 json 数据问题
- ASP.net 请求URL过长问题处理
- 解决asp.net mvc的跨域请求问题
- ASP.NET“由于无法创建应用程序域,因此未能执行请求”问题一步一步解决
- ASP.net Session阻塞、Session锁、MVC Action请求阻塞问题
- 关于在IIS中出现ASP.NET 未被授权访问所请求的资源问题的解决
- 解决asp.net mvc的跨域请求问题
- 解决asp.net上传文件超过了最大请求长度的问题
- 新建了android项目就出现了问题 请求各位大神帮助
- Asp.net查询请求QueryString过长问题
- IIS ASP.NET网站部署问题解决: ASP.NET 未被授权访问所请求的资源。请考虑授予 ASP.NET 请求标识访问此资源的权限。
- asp.net web api 解决ajax跨站点post请求提交 json 数据问题
- 解决ASP.NET中ServiceStack.Redis每小时6000次访问请求的问题
- Asp.net中处理请求中含有&字符的解析报400错误的问题
- ASP.net 请求URL过长问题处理
- ASP.NET WEB API 帮助文档引用单独项目中的DTO,见面上不显示字段注释问题解决办法
- IIS ASP.NET网站部署问题解决: ASP.NET 未被授权访问所请求的资源。请考虑授予 ASP.NET 请求标识访问此资源的权限。
- ASP.NET跨域请求中的问题【CORS】
- "无法向会话状态服务器发出会话状态请求。请确保 ASP.NET State Service (ASP.NET 状态服务)已启动"问题解决方法
- 一个关于Schema的问题,请求帮助