getstocks.asp

来自「静宁成纪中学2006版 欢迎使用!」· ASP 代码 · 共 31 行

ASP
31
字号
<%@language=vbscript codepage=936 %>
<%
Option Explicit
%>
<!--#include file="../conn.asp"-->
<%
Dim ProductID
Dim rs,iStocks
ProductID = Trim(request("ProductID"))
If IsNumeric(ProductID) then
	ProductID=Clng(ProductID)
else
	ProductID=0
end if
If ProductID > 0 Then
	Set rs = Conn.Execute("select Stocks,OrderNum from PE_Product where ProductID=" & ProductID & "")
	If rs.BOF And rs.EOF Then
		iStocks=0
	else
		iStocks=rs(0)-rs(1)
		if iStocks<0 then iStocks=0
	End If
	rs.close
	set rs=nothing
else
	iStocks=0
End If

Response.Write "document.write('" & iStocks & "');"
Call CloseConn
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?