Location: PHPKode > projects > VideoSplurge > includes/categorylist.php
<?php
function showcategorylist()
{
	//echo "<table width=\"100%\">\n";
	//echo "<tr><td class=\"box\">\n";

	$sql = "SELECT * FROM categories WHERE Parent=-99";
	$result = mysql_query($sql);
	$numrows = mysql_num_rows($result);
	if($numrows > 0) {
		echo "<strong>Categories</strong><br />\n";
		for($num=0;$num<$numrows;$num++) {
			$row = mysql_fetch_row($result);
			$CatNameL1 = stripslashes($row[2]);
			echo "&nbsp;&nbsp;<font size=\"-1\"><a href=\"$siteurl" . "category.php?id=$row[0]\">$CatNameL1</a></font><br />\n";
			
			$sql2 = "SELECT * FROM categories WHERE Parent=$row[0]";
			$result2 = mysql_query($sql2);
			$numrows2 = mysql_num_rows($result2);

			if($numrows2>0) {
				for($num2=0;$num2<$numrows2;$num2++) {
					$row2 = mysql_fetch_row($result2);
					$CatNameL2 = stripslashes($row2[2]);
					echo "&nbsp;&nbsp;&nbsp;&nbsp;<font size=\"-2\"><a href=\"$siteurl" . "category.php?id=$row2[0]\">$CatNameL2</a></font><br />\n";
				}
			}
		}
	}
	echo "<br />\n";
	//echo "</td></tr></table>\n";
}

function getcategoryname($categoryid)
{
	$sql = "SELECT * FROM categories WHERE id=$categoryid";
	$result = mysql_query($sql) or die(mysql_error());
	$numrows = mysql_num_rows($result);
	if($numrows>0) {
		$row = mysql_fetch_row($result);
		$CategoryName = stripslashes($row[2]);
	}
	return $CategoryName;
}
?>
Return current item: VideoSplurge