Print Page | Close Window

custom "favorites" list

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=4761
Printed Date: 30 March 2026 at 3:02pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: custom "favorites" list
Posted By: KCWebMonkey
Subject: custom "favorites" list
Date Posted: 05 August 2003 at 10:19am

I want to be able to make a custom "favorites" list of links that the users creates, and then it displays the list of favorites stored under their username.

I have a unique ID number for each link, and the username is pulled from their NT LOGON_USER.

how do i save this to a DB and then display the records on the "favorites" page?

please let me know if i need to provide more info...Thanks.




Replies:
Posted By: michael
Date Posted: 05 August 2003 at 12:30pm
You can just loop the recordset like first setting the SQL to something like
Select * from yourtable where UserID = '" Trim(Request.ServerVariables("Logon_User")) & "'"

Then just print all the records in your fashion like to a table....

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: KCWebMonkey
Date Posted: 05 August 2003 at 1:39pm
right, but how do i store the link ID's for each user? do i have to make a different field for each user?


Posted By: michael
Date Posted: 05 August 2003 at 3:44pm
I would. A basic table layout could be
LinkID    USERID         Description   URL
1          domain\usr1   Microsoft      http://www.microsoft.com - www.microsoft.com
2          domain\usr2   WWG           http://www.webwiz.net - www.webwiz.net

etc.

I would not have a field for every user per se in the table, create an entry for every link.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: KCWebMonkey
Date Posted: 05 August 2003 at 4:32pm

Thanks michael for the help.

I want to be able to store MULTIPLE link id's (or "link favorites") for each userID, and then display the favorites on the page when the user visits the "favorites" page.

The table layout that you have gives just one link per user.
Do i need multiple tables in my DB with some kind of relationship between them  or what?



Posted By: michael
Date Posted: 05 August 2003 at 5:18pm
No, one user can have 100 entries in the table, all with a different link, you just query by userid and return (loop) all links.
I have one table similar where I am actually forced to store it in the way of 100,112,144 etc. and the put them into an array but I would avoid that.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: KCWebMonkey
Date Posted: 06 August 2003 at 7:49am

What if i did something like this? I could just loop through and find the "True" values for a certain user's column...

idNum

linkURL

linkName

user1

user2

1

www.microsoft.com

Microsoft

True

 

2

www.chicken.com

Chickens

 



Posted By: Flamewave
Date Posted: 06 August 2003 at 8:19am
Why have a column for every user though when you could just have one column that stores the username, then in your select statement, you can filter out all the records that dont belong to that user by adding something like this: where username = 'user1'. That will return a recordset with all of the links for that user.

-------------
- Flamewave

They say the grass is greener on the other side, but if you really think about it, the grass is greener on both sides.


Posted By: michael
Date Posted: 06 August 2003 at 8:29am
KC, the way you proposed would have you change the table layout everytime someone gets hired or fired. I would really stick with the simple layout.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: KCWebMonkey
Date Posted: 06 August 2003 at 9:52am

I'm feeling like a moron here...

You guys are telling me to do this:

linkID

userID

linkName

linkURL

1

Bob_Billy

Microsoft

www.microsoft.com

2

Duck_Donald

Chickens

www.chicken.com

3



Posted By: zaboss
Date Posted: 06 August 2003 at 11:48am

 

linkID

userID

linkName

linkURL

1

Bob_Billy

Microsoft

www.microsoft.com

2

Duck_Donald

Chickens

www.chicken.com

3

Doe_John

-------------
Cristian Banu
http://www.soft4web.ro - Soft 4 web



Posted By: KCWebMonkey
Date Posted: 06 August 2003 at 12:40pm

LOL, I can be such a dumb a$$ sometimes. Thanks guys.



Posted By: KCWebMonkey
Date Posted: 07 August 2003 at 7:05am

 Edit: had an error. figured out that i'm a moron. fixed it. thanks.

<% DO WHILE NOT RS.EOF %><% DO WHILE NOT RS.EOF %><% DO WHILE NOT RS.EOF %><% DO WHILE NOT RS.EOF %><% DO WHILE NOT RS.EOF %>



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net