Jump to content

Categorys and making them link


Bobd314

Recommended Posts

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)

Link to comment
https://forums.phpfreaks.com/topic/1468-categorys-and-making-them-link/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.