Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.