[Solved] Single result from database using mysqli
When just a single result is needed, then no loop should be used. Just fetch the row right away. In case you need to fetch the entire row into associative array: $row = $result->fetch_assoc(); in case you need just a single value $row = $result->fetch_row(); $value = $row[0] ?? false; The last example will return … Read more