Author |
Topic |
|
muzishun
Senior Member
United States
1079 Posts |
Posted - 28 May 2006 : 17:32:08
|
I'm working on an application using Snitz, and I'm trying to figure out the best way to do part of it.
Users will be able to select from their profile which categories and forums are displayed to them on the main page. The same will go for evens (already added the calendar MOD). What I'm wondering is if it would be faster to: (a) store the information in a Session variable or cookie, then loop through the list of cats and forums they want to display and verify that events fall under these, or (b) hit the database with a large query with a bunch of "WHERE cat = x OR cat = y OR cat = z...." tacked on, or (c) something I haven't thought of yet (if there's a simpler way to do this, I'm all ears)
Hope that's a little clearer than mud. Looking back through it I'm not sure I explained it well, but let me know if there's something I need to clarify more.< |
Bill Parrott Senior Web Programmer, University of Kansas Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com) Personal Website (www.chimericdream.com) |
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 29 May 2006 : 05:23:08
|
I'd go with modifying the existing query to select the exact forums the user wants to see, something along the lines of:
SELECT [FIELDS] FROM [TABLES] WHERE [CONDITIONS] AND CAT_ID IN (SELECT CAT_ID FROM [YOUR_NEW_TABLE] WHERE MEMBER_ID="&MemberID&")
Depending on the database you're using, you may have to pull that nested query out and run it sperately.
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
muzishun
Senior Member
United States
1079 Posts |
Posted - 29 May 2006 : 11:03:37
|
Thanks. I'm using MySQL, so the queries should run fairly fast. I'm also looking into the possibility of this being on a dedicated server (in the future, if this grows like we're hoping it will), so that will help with some performance issues.
I had a feeling that might be the simplest way to do it, but wanted to double check it with people here, since I'm still relatively new in comparison.< |
Bill Parrott Senior Web Programmer, University of Kansas Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com) Personal Website (www.chimericdream.com) |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 29 May 2006 : 11:32:32
|
Ay, trouble with doing it with session varaibles is that they'd have to be repopulated every time the members started a new session, requiring an additional db hit each time.
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
muzishun
Senior Member
United States
1079 Posts |
Posted - 30 May 2006 : 16:43:54
|
That's true. Looks like I'll end up going the route of nested query. Thanks for the help.< |
Bill Parrott Senior Web Programmer, University of Kansas Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com) Personal Website (www.chimericdream.com) |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 31 May 2006 : 04:42:06
|
You're welcome, Bill
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
|
Topic |
|