Forums

ASP

This topic is locked

i hate to do this but

Posted 10 Nov 2001 12:22:02
1
has voted
10 Nov 2001 12:22:02 jon badda posted:
my original post

"I need away of making it so that if the values of UserID and ProductID in my Orders table are equal, then to not insert any more.
Basically, if the a user orders the same product then dont enter it.
several ideas havent worked, the last solution that didnt work was making both columns indexed(no duplicates) ...
so...is there help to be found? or a handy extension perhaps? Im at an end here.
"

and i got a reply with code in another language, which although im grateful for, its hard to interpret ...

I hate to do this but, is there an english solution to my problem or a translation of the code?

Replies

Replied 10 Nov 2001 13:36:10
10 Nov 2001 13:36:10 Some One replied:
Yeah here then code....
<font face='Courier New'>&lt;%
Dim sepetkontrol__MMColParam, sepetkontrol__MMColParam2
sepetkontrol__MMColParam = logok.Fields.Item("user_id".Value '*** User id
sepetkontrol__MMColParam2 = Request.Querystring("urun"'*** Product

set sepetkontrol = Server.CreateObject("ADODB.Recordset"
sepetkontrol.ActiveConnection = MM_zafer_STRING
sepetkontrol.Source = "SELECT * FROM sepet WHERE user_id = " + Replace(sepetkontrol__MMColParam, "'", "''" + " AND product_id =" & sepetkontrol__MMColParam2
sepetkontrol.CursorType = 0
sepetkontrol.CursorLocation = 2
sepetkontrol.LockType = 3
sepetkontrol.Open()
sepetkontrol_numRows = 0
%&gt;

&lt;% If sepetkontrol.EOF And sepetkontrol.BOF Then
The same hey you got it already!
&lt;%Else%&gt;
insert new one etc....
&lt;%End If ' end sepetkontrol.EOF And sepetkontrol.BOF %&gt;
</font id='Courier New'>

sdi ::: pixels to blood

Reply to this topic