Im making a CMS that has links that are retrieved from a database.
I have these lines in LINKS.INC
$sql = “SELECT id, heading FROM superintendent”;
$result = mysql_query($sql) or die(“Couldn’t get file list”);
while($row = mysql_fetch_array($result))
{
?>
<a href="<?php echo ($row[“id”] . “.php”); ?>"><?php echo ($row[“heading”]); ?></a>
<?php
}
?>
If I have 10 links, it’ll show them. But i want to add an extra column to my table. Column ACTIVE. if it’s set to NO, i dont want the link to show. if its set to YES, i want the link to show. For example, let’s say
IDs 1 through 5 are set to YES
IDs 6 through 8 are set to NO
IDs 9 and 10 are set to YES
How would I be able to show ONLY the links that are set to YES?