Slicker solution?

This is a discussion on "Slicker solution?" within the Classic ASP section. This forum, and the thread "Slicker solution? are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 8th, 2007, 08:59
Junior Member
Join Date: Aug 2007
Location: UK
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Talking Slicker solution?

Hi, I am building a small website for a snooker club. I have one ASP page that displays historic data, (tournament results etc) grouped in categories and contained in a DIV. The problem I have is that my customer wants to be able to view by category, i.e click on a category and only see that category displayed in the results. Would I have to provide a new page for each category where the SQL is hard coded or is there a slicker solution I can employ?
Reply With Quote

  #2 (permalink)  
Old Aug 8th, 2007, 14:02
c010depunkk's Avatar
SuperMember

SuperMember
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to c010depunkk
Re: Slicker solution?

No, you could do it dynamically with PHP.

Here's some untested pseudo code:

The SQL table has, for example, three columns - one | two | three
HTML:
Code: Select all
<a href="?sort_key=one">one</a>
<a href="?sort_key=two">two</a>
<a href="?sort_key=three">three</a>
PHP:
PHP: Select all

// mysql query
$query=mysql_query("SELECT * FROM tablename SORT BY ".$_GET['sort_key']." ASC");
while(
$row=mysql_fetch_object($query)) {
  echo(
"<p>".$row->one." | ".$row->two." | ".$row->three."</p>");

Hope that helps.
Reply With Quote
  #3 (permalink)  
Old Aug 8th, 2007, 15:22
Junior Member
Join Date: Aug 2007
Location: UK
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb Re: Slicker solution?

Thanks for that; although I haven't much of a clue how to use PHP or MySQL, I think I can follow your code. Maybe I can pass an argument to the code that creates the query and just reload the page. I really am going to have to get to grips with MySQL Thanks again

Rob
Reply With Quote
Reply

Tags
asp

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop-down menu solution? Sanehouse Web Page Design 10 May 2nd, 2008 11:02
Need internet marketing solution? hretlin PHP Forum 1 Mar 8th, 2008 07:17
Help can't find solution bcwups Web Page Design 2 Nov 30th, 2007 18:50
Can't think of a solution!! snowangel PHP Forum 3 Mar 12th, 2006 21:20
New Member, looking for a web solution timthompson Job Opportunities 2 Feb 26th, 2006 07:36


All times are GMT. The time now is 06:27.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43