Jump to content


Photo

Categorys and making them link


  • Please log in to reply
1 reply to this topic

#1 Bobd314

Bobd314
  • Members
  • Pip
  • Newbie
  • 3 posts

Posted 07 December 2003 - 02:15 AM

Hmm, well I need a way to sort all the things in the MySQL database I made. I have a download\'s category but I want to be able to have a page that lists all the categorys and then the category is a link to a page that has all the download\'s that are in that category. Also if the category is \'font\' on one and \'font\' on another one I dont want it to show 2 links for \'font\'. I have the page to add download\'s and crap but I dont know how to make this. I also have a page now that shows all the downloads just in a list but it doesnt category\'ize them. (Yes I know I posted this in the PHP secion too but I dont know where it would go)

#2 triphis

triphis
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts

Posted 07 December 2003 - 07:23 PM

Well, you just make a page that lists all the categories. Then, using a typical HTML link, do this:

<a href="http://www.yourdomain.com/whatever.php?cat=font">Font</a><br><a href="http://www.yourdomain.com/whatever.php?cat=games">Games</a>

Etc. Then, on that something.php page, do this:

$q="SELECT * FROM table WHERE category=$cat ORDER BY name ASC";

YOu know how to do mysql... That statement will take all items with that category, and order them alphabetically.
Xac Attack




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users