Forums
This topic is locked
Certain problems with codes
01 Oct 2001 08:55:05 Nam Lee posted:
Hello Everybody,
I am doing an Ultrcart and I encounter some problems with the understanding of some codes.
(Request("artist" <> "-1" and (Request("occasion"<>"-1"
From what I understand from the comments, it is talking about a specific artist or occasion? Does it mean any number apart from "-1" is talking about a spcific thing?? Then does it mean "-1" talks about a random thing??
I hope someone can help me understand thanks!
Replies
Replied 02 Oct 2001 02:29:56
02 Oct 2001 02:29:56 Owen Eastwick replied:
Was there more to this bit of code? For example was it after an IF statement?
Is it from Foundation DW UD4 Page 262?
<pre id=code><font face=courier size=2 id=code>
If (Request("artist" <> "-1" and (Request("occasion"<>"-1" and Request.Querystring ("UC_AddID = ""Then
sqlString = " WHERE products.occasion_id = " & Request.("occassion"& " AND Products.artist_id = " & Request("artist"
End If
</font id=code></pre id=code>
In English:
If the value held in the variable "artist" is anything but "-1" (or NOT EQUAL to "-1" AND the value held in the variable "occasion" is anything but "-1" Then
Create a variable called <b>sqlString</b> and store the following int it:
<b>WHERE products.occasion_id = </b> and the value held in <b>ocasion</b> and <b> AND Products.artist_id = </b> and the value held in <b>artist</b>
<b>End If</b> - If the value held either "artist" or "ocassion" was "-1" then don't bother with the previous bit of code, but continue executing the rest of the code from here on.
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Is it from Foundation DW UD4 Page 262?
<pre id=code><font face=courier size=2 id=code>
If (Request("artist" <> "-1" and (Request("occasion"<>"-1" and Request.Querystring ("UC_AddID = ""Then
sqlString = " WHERE products.occasion_id = " & Request.("occassion"& " AND Products.artist_id = " & Request("artist"
End If
</font id=code></pre id=code>
In English:
If the value held in the variable "artist" is anything but "-1" (or NOT EQUAL to "-1" AND the value held in the variable "occasion" is anything but "-1" Then
Create a variable called <b>sqlString</b> and store the following int it:
<b>WHERE products.occasion_id = </b> and the value held in <b>ocasion</b> and <b> AND Products.artist_id = </b> and the value held in <b>artist</b>
<b>End If</b> - If the value held either "artist" or "ocassion" was "-1" then don't bother with the previous bit of code, but continue executing the rest of the code from here on.
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 02 Oct 2001 03:25:01
02 Oct 2001 03:25:01 Nam Lee replied:
Thanks a lot for your prompt reply.
Yes the question is from the Foundation Ultradev on page 262.
I have another question though. They told us to input this code :
(Request.QueryString("UC_AddID" =""
From what I understand is the reason why you want to input this code is to test whether the "add to cart" button has been pressed. But why must the QueryString point it to a Null?
Care to explain?
Yes the question is from the Foundation Ultradev on page 262.
I have another question though. They told us to input this code :
(Request.QueryString("UC_AddID" =""
From what I understand is the reason why you want to input this code is to test whether the "add to cart" button has been pressed. But why must the QueryString point it to a Null?
Care to explain?