帮我看看,是个存储过程问题


就是交友网站,看一般的交友网站都会有加把会员加为好友,设黑名单这种的,我的问题是通过调用了一个存储过程,获得了想加好友的那个的id号,怎么才能把调用的id号存到数据库里呀
这个是通过这里,点击进入加为好友
<a href="z1.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-->
<%
userid=request.Cookies("userid")
hyid1=request("hyid1")
set rs1=server.CreateObject("adodb.recordset")
rs1.Open "exec web_Addfirend '"+userid+"','"+hyid1+"'",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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值