I need to sort while loop by row named 'sort' or $udaj[5] My code below.
<?php
$query = "SELECT * FROM yees where category = 1";
$vysledek = mysqli_query($my_link, $query);
while ($udaj = mysqli_fetch_array($vysledek)):
echo "<a href='detail.php?id=" . $udaj[0] . "' class='yee'>";
echo "<img src='" . $udaj[3] . "' alt='' class='avatar'>";
echo "<div class='basic-info'>";
echo "<div class='name'>" . $udaj[1]."</div>";
echo "<div class='tagline'>" . $udaj[6] . "</div>";
echo "</div>";
echo "<img src='" . $udaj[4] . "' alt='' class='cover'>";
echo "<div class='clear'> </div>";
echo "</a>";
endwhile;
?>
I tried this, but doesnt work.
$query = "SELECT * FROM yees where category = 1 ORDER BY sort ASC";
Could the problem be that my col is called "sort" which is not allowed since its a keyword??