hi all.
i am making a small database of links. each link is categorised
depending on the category it is entered into.
i am having trouble displaying the links correctly. for some reason I
cannot seem to get the links listed in the correct category, nor will
they align alphabetically.
here is the display code I am using, can anyone spot the problems?
<?php
$sql = "SELECT * FROM info ORDER BY catagory";
$result = mysql_query($sql) or die('There are currently no links in the
database.');
$temp = "";
while ($row = mysql_fetch_assoc($result))
{
$catagory = $row['catagory'];
$url = $row['url'];
$title = $row['title'];
if ($catagory != $temp)
echo "</ul>\n</div>\n\n<div class='left'>\n<h1>$catagory</h1>\n<ul>\n";
$temp = $catagory;
echo "<li><a href='$url' target='_blank'>$title</a></li>\n";
}
echo "</ul>\n";
echo "</div>\n\n";
?>
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/php-list/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/