I want to get the first 10 results of an array, but with the current code, it lets my one get the first one.
$query = "SELECT name FROM `table` ORDER BY `id` DESC LIMIT 10";
$result = mysqli_query($sql, $query);
$row = mysqli_fetch_array($result, MYSQLI_NUM);
echo $row['0']; //I can do this.
echo $row['2']; // I can't do this. (It's echoing nothing).
How can I get number 1, 2,3 etc... from an array?
Thanks!