Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - custom
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

custom "favorites" list

 Post Reply Post Reply Page  12>
Author
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Post Options Post Options   Thanks (0) Thanks(0)   Quote KCWebMonkey Quote  Post ReplyReply Direct Link To This Post Topic: custom "favorites" list
    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.

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Post Options Post Options   Thanks (0) Thanks(0)   Quote KCWebMonkey Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 05 August 2003 at 3:44pm
I would. A basic table layout could be
LinkID    USERID         Description   URL
1          domain\usr1   Microsoft      www.microsoft.com
2          domain\usr2   WWG           www.webwiz.net

etc.

I would not have a field for every user per se in the table, create an entry for every link.
Back to Top
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Post Options Post Options   Thanks (0) Thanks(0)   Quote KCWebMonkey Quote  Post ReplyReply Direct Link To This Post 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?

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Post Options Post Options   Thanks (0) Thanks(0)   Quote KCWebMonkey Quote  Post ReplyReply Direct Link To This Post 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

 

Back to Top
Flamewave View Drop Down
Senior Member
Senior Member
Avatar

Joined: 19 June 2002
Location: United States
Status: Offline
Points: 376
Post Options Post Options   Thanks (0) Thanks(0)   Quote Flamewave Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.