Hi, I'm using a mysql database to store information for the frontpage of my website, http://claninfectionist.com, I'm adding the tutorials right now, everything thing is going fine, but there is a problem that I forsaw, and lo and behold it happened. I'm one table called tutorials and storing the tutorials with one value being type, (example: photoshop, gimp, apophysis.) I want to use the type column to make a category page, the code I am using is this:
[PHP]$sql = mysql_query('SELECT `type` FROM `tutorials`') or die("Error: ".mysql_error());
while($info = mysql_fetch_array($sql)) {
echo ucfirst($info['type'])."<br />";
}[/PHP]
Since I have more than one of each type of tutorial (actually, right now, I have two of each) its printing out the type for each one, so I'm getting two photoshops, two gimps, and two apophysis'. Is there some code that I can use to only pull out each type once, even if it is in the type field more than once. My first thought was some comparison code, but I've not been doing PHP for long, so I don't really know how. Can anyone give me an easy way (or just any way, if there is no easy way, I'm not too picky) to do this please, I would be very grateful.
The reason that I have the type in there like this, instead of having each type in its own seperate table, is becuase I want to have someone be able to go to http://claninfectionist.com/tutorials/ and it'll show all the different programs we have tutorials for, then if they go to http://claninfectionist.com/tutorials/?cat=photoshop, it'll show all the tutorials for photoshop, then they can go to http://claninfectionist.com/tutorial...tut=GrungeText and it'll show that tutorial. I know this is possible, and relatively simple, so can anyone help me?
~HaLo2FrEeEk