I’m attempting to display links from my navigation table in my SQL server. My query to select links is as follows however when used none of the links display or only one link (IE not taking the loop into account)
$query = "SELECT link FROM navigation WHERE permission<='3'";
$result = mysqli_query($link, $query);
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC));
echo '<li>';
echo $row['link'];
echo '</li>';
I have also tried using
$query = "SELECT link FROM navigation WHERE permissions<='3'";
$result = mysqli_query($link, $query);
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
echo '<li>';
echo $row['link'];
echo '</li>';
My original code was a simple mysql_select and was
$result=mysql_query("SELECT * FROM navigation WHERE enabled='1' AND permission<='3'");
while ($row=
mysql_fetch_array($result))
{
echo '<li>';
echo $row['link'];
echo '</li>';
}
?>
This:
Should look like this:
You have to define the code block as such.