I'm building my website and in one of its pages, I use MySQL and PHP to load some information. Although, the page is taking a long time to load when compared to all the other pages that don't use the database.
In my code, I use many times:
$selectMember = mysql_query("SELECT name, nametag FROM members");
$countMembers = mysql_num_rows($selectMember);
[...]
for($ID = 1; $ID <= $countMembers ; $ID++){
$member = mysql_query("SELECT name, nametag FROM members WHERE ID = $ID");
while($row = mysql_fetch_array($member)) {
I believe the problem is in this part of the code. Didn't want to put the whole one because it has 200 lines. Is there any way to make the database research simpler and/or make the page load faster?