Hello,
My thanks in the beginning and please help understand what's the problem. I've started using php and trying to build my very first small website with a few categories and many pages. So I wrote a function:
Code:
function getFirstMenu() {
$query = mysql_query("SELECT `cat_name`, `cat_id` FROM `category`") or die(mysql_error());
while($menu = mysql_fetch_assoc($query)) {
echo '<li><a href="?cat='.$menu['cat_id']. '">'.$menu['cat_name'].'<a/></li>';
}
}
and I'm using it here
Code:
<ul>
<li><a href="index.php" target="_top">Home</a></li>
<?php getFirstMenu();?>
</ul>
can someone please tell me why it's outputting 2 links instead of one in a li like this. Second <a> is empty
Code:
<li>
<a href="?cat=1">Name</a>
<a></a>
</li>
Thank you