当前用户添加信息成功时,让表内tgzs字段值+1 ,该写在哪里?附代码_百度...
发布网友
发布时间:2024-07-03 12:00
我来回答
共1个回答
热心网友
时间:2024-07-14 18:06
信息记录的表是sd_info ,下面是添加信息的代码:
(用户表是sd_members,有一个字段是tgzs 默认是0,当添加一个信息时,让tgzs+1,该怎么加,加在哪里,谢谢了。)
代码
<%
End Sub
Sub Save
adddate=trim(request("adddate"))
t0=trim(request("t0"))
t1=trim(request("t1"))
t2=trim(request("t2"))
t3=trim(request("t3"))
t4=request("t4")
t5=trim(request("t5"))
t6=trim(request("t6"))
t7=trim(request("t7"))
t8=trim(request("t8"))
t9=trim(request("t9"))
t10=trim(request("t10"))
t11=trim(request("t11"))
t13=trim(request("t13"))
t15=trim(request("t15"))
t16=Replace_filename(dir_check(trim(request("t16"))))
t17=trim(request("t17"))
t17=Re(t17," "," ")
t17=Re(t17," ",",")
t17=Re(t17," ",",")
t17=Re(t17,",",",")
t17=check_event(t17,",")
t18=trim(request("t18"))
t19=Requestint(trim(request("t19")),0)
t20=Requestint(trim(request("t20")),0)
t21=trim(request("t21"))
t22=Requestint(trim(request("t22")),0)
IF t20=0 Then
Sdcms_Label=Split(t17,",")
LikeID=Empty
Set LikeIDData=Server.CreateObject("Scripting.Dictionary")
For I=0 To Ubound(Sdcms_Label)
Set Rs=Conn.Execute("Select top 5 ID From "&Sd_Table&" Where Title Like '%"&Sdcms_Label(I)&"%'")
While Not Rs.Eof
IF LikeIDData.Exists(Rs(0)) Then LikeIDData.Item(Rs(0))=Rs(0)&"," Else LikeIDData.Add Rs(0),Rs(0)&","
Rs.MoveNext
Wend
Next
LikeIDtag=LikeIDData.keys
LikeIDval=LikeIDData.items
IF LikeIDData.Count>=1 Then
For I=0 To LikeIDData.Count-1
LikeID=LikeID&LikeIDval(i)
Next
End IF
Set LikeIDData=Nothing
IF Len(LikeID)>0 Then t21=LikeID
End IF
t21=Check_Event(t21,",")
IF Len(t21)=0 Then t21=0
up1=trim(request("up1"))
up2=trim(request("up2"))
up3=trim(request("up3"))
up4=trim(request("up4"))
up5=trim(request("up5"))
up6=Requestint(trim(request("up6")),0)
IF up6=1 Then
Set P=New Get_Pinyin
t16=P.Pinyin(t0)
Set P=Nothing
End IF
IF t15<>"" And t2=0 then t4=ReplaceRemoteUrl(t4,"","","","")
t5=RequestInt(t5,0)
t12=Check_ispic(t11)
t14=is_sdcms(t11)
IF Len(t6)=0 Then t6=0
IF Len(t7)=0 Then t7=0
IF Len(t8)=0 Then t8=0
Set Rs=Server.CreateObject("adodb.recordset")
sql="select top 1 * from "&sd_table&""
IF act="save" Then
sql=sql&" where id="&id&""
End IF
Rs.Open Sql,Conn,1,3
IF Act="add" Then
Rs.Addnew
Else
Rs.Update
End IF
IF Rs("title")=""&t0&"" Then
Ischanage=0
Else
Ischanage=1
End IF
rs("title")=Left(t0,255)
rs("author")=Left(t1,50)
rs("isurl")=t2
IF t2=1 Then
rs("url")=Left(t3,255)
Else
rs("content")=t4
End IF
rs("hits")=Left(t5,6)
问题补充:IF Len(up3)>0 Then
part_classid=get_part_classid(t13)
IF Instr(part_classid,",")>0 Then
part_classid=Split(part_classid,",")
For i=0 to Ubound(part_classid)
sdcms_c.Create_class_list part_classid(i)
Next
Else
sdcms_c.Create_class_list t13
End IF
End IF
IF Len(up5)>0 Then sdcms_c.Create_info_show id
IF t19>0 And Len(up5)>0 Then sdcms_c.Create_Topic t19
IF act="save" And Len(up5)>0 Then Conn.Execute("update "&sd_table&" set iscreate=1 where id="&id&"")
IF Len(up2)>0 Then sdcms_c.Create_index
Del_Cache("comment"&id):Del_Cache("comment_"&id)
Echo "信息保存成功"
Set sdcms_c=Nothing
End Sub
Sub makehtml
End Sub
热心网友
时间:2024-07-14 18:11
信息记录的表是sd_info ,下面是添加信息的代码:
(用户表是sd_members,有一个字段是tgzs 默认是0,当添加一个信息时,让tgzs+1,该怎么加,加在哪里,谢谢了。)
代码
<%
End Sub
Sub Save
adddate=trim(request("adddate"))
t0=trim(request("t0"))
t1=trim(request("t1"))
t2=trim(request("t2"))
t3=trim(request("t3"))
t4=request("t4")
t5=trim(request("t5"))
t6=trim(request("t6"))
t7=trim(request("t7"))
t8=trim(request("t8"))
t9=trim(request("t9"))
t10=trim(request("t10"))
t11=trim(request("t11"))
t13=trim(request("t13"))
t15=trim(request("t15"))
t16=Replace_filename(dir_check(trim(request("t16"))))
t17=trim(request("t17"))
t17=Re(t17," "," ")
t17=Re(t17," ",",")
t17=Re(t17," ",",")
t17=Re(t17,",",",")
t17=check_event(t17,",")
t18=trim(request("t18"))
t19=Requestint(trim(request("t19")),0)
t20=Requestint(trim(request("t20")),0)
t21=trim(request("t21"))
t22=Requestint(trim(request("t22")),0)
IF t20=0 Then
Sdcms_Label=Split(t17,",")
LikeID=Empty
Set LikeIDData=Server.CreateObject("Scripting.Dictionary")
For I=0 To Ubound(Sdcms_Label)
Set Rs=Conn.Execute("Select top 5 ID From "&Sd_Table&" Where Title Like '%"&Sdcms_Label(I)&"%'")
While Not Rs.Eof
IF LikeIDData.Exists(Rs(0)) Then LikeIDData.Item(Rs(0))=Rs(0)&"," Else LikeIDData.Add Rs(0),Rs(0)&","
Rs.MoveNext
Wend
Next
LikeIDtag=LikeIDData.keys
LikeIDval=LikeIDData.items
IF LikeIDData.Count>=1 Then
For I=0 To LikeIDData.Count-1
LikeID=LikeID&LikeIDval(i)
Next
End IF
Set LikeIDData=Nothing
IF Len(LikeID)>0 Then t21=LikeID
End IF
t21=Check_Event(t21,",")
IF Len(t21)=0 Then t21=0
up1=trim(request("up1"))
up2=trim(request("up2"))
up3=trim(request("up3"))
up4=trim(request("up4"))
up5=trim(request("up5"))
up6=Requestint(trim(request("up6")),0)
IF up6=1 Then
Set P=New Get_Pinyin
t16=P.Pinyin(t0)
Set P=Nothing
End IF
IF t15<>"" And t2=0 then t4=ReplaceRemoteUrl(t4,"","","","")
t5=RequestInt(t5,0)
t12=Check_ispic(t11)
t14=is_sdcms(t11)
IF Len(t6)=0 Then t6=0
IF Len(t7)=0 Then t7=0
IF Len(t8)=0 Then t8=0
Set Rs=Server.CreateObject("adodb.recordset")
sql="select top 1 * from "&sd_table&""
IF act="save" Then
sql=sql&" where id="&id&""
End IF
Rs.Open Sql,Conn,1,3
IF Act="add" Then
Rs.Addnew
Else
Rs.Update
End IF
IF Rs("title")=""&t0&"" Then
Ischanage=0
Else
Ischanage=1
End IF
rs("title")=Left(t0,255)
rs("author")=Left(t1,50)
rs("isurl")=t2
IF t2=1 Then
rs("url")=Left(t3,255)
Else
rs("content")=t4
End IF
rs("hits")=Left(t5,6)
问题补充:IF Len(up3)>0 Then
part_classid=get_part_classid(t13)
IF Instr(part_classid,",")>0 Then
part_classid=Split(part_classid,",")
For i=0 to Ubound(part_classid)
sdcms_c.Create_class_list part_classid(i)
Next
Else
sdcms_c.Create_class_list t13
End IF
End IF
IF Len(up5)>0 Then sdcms_c.Create_info_show id
IF t19>0 And Len(up5)>0 Then sdcms_c.Create_Topic t19
IF act="save" And Len(up5)>0 Then Conn.Execute("update "&sd_table&" set iscreate=1 where id="&id&"")
IF Len(up2)>0 Then sdcms_c.Create_index
Del_Cache("comment"&id):Del_Cache("comment_"&id)
Echo "信息保存成功"
Set sdcms_c=Nothing
End Sub
Sub makehtml
End Sub