Forums

This topic is locked

When users Log in, they view specific data

Posted 29 Jun 2007 04:49:47
1
has voted
29 Jun 2007 04:49:47 almahdi ali posted:
Hi to all, i will gladly appreciate any assistance on the following:

Im using Dreamweaver to build a product catalog. I want that when users sign into my website, they are taken to a page showing them their favorite product categories. I have already built the user log in, and i have built the recordset to show product category name. I filtered the recordset by "userid" and the default value in the advanced recordset appears as "1". My problem is that when any user signs in, they see the categories for the user of userid "1" which is the default value.

I tried removing the default value, but then it returns no data on when any user logs in. I tried using the Like statement is the SQL with the % wild card...but then it returns all categories as if there was no filter. So if sam signs in.....i want that sam sees his favorite categories......and so on. PLEEEEZE HELP! <img src=../images/dmxzone/forum/icon_smile_sad.gif border=0 align=middle>

This is the code for the recordset and the filter....:

&lt;%
Dim rsFavorite_Categories__MMColParam
rsFavorite_Categories__MMColParam = "1"
If (Request.QueryString("usrid" &lt;&gt; "" Then
rsFavorite_Categories__MMColParam = Request.QueryString("usrid"
End If
%&gt;
&lt;%
Dim rsFavorite_Categories
Dim rsFavorite_Categories_numRows

Set rsFavorite_Categories = Server.CreateObject("ADODB.Recordset"
rsFavorite_Categories.ActiveConnection = MM_connpractise_STRING
rsFavorite_Categories.Source = "SELECT * FROM FvrtsCtgrs WHERE usrid = " + Replace(rsFavorite_Categories__MMColParam, "'", "''" + " ORDER BY ctgrynme ASC"
rsFavorite_Categories.CursorType = 0
rsFavorite_Categories.CursorLocation = 2
rsFavorite_Categories.LockType = 1
rsFavorite_Categories.Open()

rsFavorite_Categories_numRows = 0
%&gt;

Reply to this topic