Hello! I am creating a database driven site that is a directory of businesses. I have a page that displays the categories and a table full of categories in the mysql database. I have a while statement get the categories that start with a certain letter and echo them on the screen. It works, but I just now noticed that it is echoing each one of the categories twice.
Here is the php snippet for that section:
<?php
$letter = $data['letter'];
$getCats = mysql_query("SELECT * FROM categories WHERE catName LIKE '$letter%' ORDER BY catName");
while ($cat = mysql_fetch_array($getCats)) {
$catID = $cat['catID'];
echo "<li><a href=\"category.php?letID=$letID&catID=$catID\">" . $cat['catName'] . "</a></li>";
}
?>
I have also attached a screenshot of what the output is like. I have looked at the code to try and see what the problem is and can't figure it out.
Thanks ahead of time for any help. I can give more information if necessary.
Key