I've created a database of links with URIs, titles, and descriptions. It is uploaded safely to my website via phpMyAdmin.
So I want to have a php page show the database similar to this hard-coded page on my blog (I'm making a replacement):
http*//blog.zoblue.com/link-list.php
I followed some tutorials online, and after some tweaking, it shows the page like this:
http*//zoblue.com/connect.php
Here's the PHP code that outputs the above:
><?php
/* connection info taken out here*/
echo 'connected successfully' . "<br /><br />\n";
$query="SELECT * FROM linklist ORDER BY 2, 4;";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close($link);
echo "<strong>Database Output</strong>\n<br />\n";
$i=0;
while ($i < $num) {
$type=mysql_result($result,$i,"type");
$name=mysql_result($result,$i,"name");
$url=mysql_result($result,$i,"url");
$desc=mysql_result($result,$i,"desc");
echo "<strong>" . $type . "</strong>\n";
echo "<dl><dt><a href='" . $url . "' title='" . $name. "'>" . $name . "</a></dt>\n";
echo "<dd>" . $desc . "</dd></dl>\n\n";
$i++;
}
echo "\n<br><br>\n";
?>
but I'd like to group the links by their category (the type column in the DB table). Can anyone help me do this? I can't wait for my PHP and MySQL books to come in the mail; young grasshopper has no patience.
thanks,
!!blue