Reputation: 15
I have a database and a table that stores the local IP addresses and information for authorization. I try to get the IP of all servers, but I only get the first one. And I don’t know how to fix it, is it even possible?
PHPMyAdmin :
Code :
Upvotes: 1
Views: 384
Reputation: 782488
If you want all hosts, don't use a WHERE
clause that restricts to certain IDs.
$result = $conn->query("SELECT host FROM baseip");
while ($row = mysqli_fetch_assoc($result)) {
echo "<option>" . $row['host'] . "</option>";
}
Upvotes: 1