I have a while loop that will echo all the results from a database. It goes something like this:
while ($row2 = mysqli_fetch_array($result2)) {
echo $row2['fname']. "<br>";
}
Problem is, I only want it to echo it out max 5 times, and if there's more than 5 people in the result I want it to show the five first results and a "Click here to view all members" button instead. I've tried searching for it, but I'm not getting any good results mostly due to poor search queries
Thanks for the downvotes and all the great answers. Sorry if I failed to conform to how one of these questions should look.