$query = "SELECT DISTINCT users FROM computers WHERE ComputerName='EN4073254W'";
while ($user_name = mysqli_fetch_array(mysqli_query($cxn, $query))) { // print out user names
printf("<li><a href='%s'>%s</a>\n", $user_name[0], $user_name[0]);
}
I am running a query to check for distinct users based on ComputerName all of this is ran through a while loop, I did this by following an example I found here. Running this query in phpMyAdmin results in correct output, so I'm roughly confident that my query is correct. I've also spent the time chopping through this line by line in phpStorm's debugger, but alas it gives me no good insight into what is happening (it just repeats itself over and over again).
<li><a href='foo'>foo</a>
<li><a href='foo'>foo</a>
<li><a href='foo'>foo</a>
<li><a href='foo'>foo</a>
<li><a href='foo'>foo</a>
<li><a href='foo'>foo</a>
<li><a href='foo'>foo</a>
...
The desired result should be something like this
<li><a href='foo'>foo</a>
<li><a href='bar'>bar</a>