In the following snippet I understand that mysqli_fetch_row only works with an index of columns (0, 1, 2 etc), not the column name.
But I consider using column numbers/ordering bad practice (what if the order changes?).
How do I return a single row, then use the column name to get the data?
$query = "Select * from users where UserEmail = '" . $UserEmail . "' LIMIT 1";
$result = mysqli_query($connection, $query);
$num_rows = mysqli_num_rows($result);
$row = mysqli_fetch_row($result);
$arr = $result->fetch_assoc();
$log->lwrite('Works / value: ' . $row[0]);
$log->lwrite('Does not work / value: ' . $arr['userID']);