I have a if statement which I am pretty sure it is correct and should work. But for some reason it is not.
while not oRs2.EOF
if iCat = oRs2("id") then
%>
<div class ="<%= oRs2("id") %><%= iCat %>">
<%
else
%>
<div class ="faqquestion <%= oRs2("id") %><%= iCat %>">
<%
end if
%>
And this is what you get.
<div class="faqquestion 11">
<div class="faqquestion 21">
<div class="faqquestion 31">
but what it should be
<div class="11">
<div class="faqquestion 21">
<div class="faqquestion 31">
cant see what i am doing wrong, 1 does = 1!?
how the variables are being set:
dim iCat
iCat = request.QueryString("cat")
dim sSQL
sSQL = "Select * from table"
set oRs2 = oConn.Execute(sSQL)
I think the problem is one of data typing.
For example I tested the following script (just take the contents and put into a file called test.vbs, then double click on it:
This will output “no” and “11”.
In your code the iCat will be a string as you’re just pulling it from
request.QueryStringso try converting it to an integer usingCInt