mysqli_fetch_assoc and mysqli_fetch_row literally do the same, assoc gives you the array with your result field names as index so this is simpler to access ( $row['name'] rather than $row[0] when using fetch_row )

First make sure you actually get a result from the query, then array_keys returns what you want but the result is accessed with numerical index. Watch the content of it with print_r for better understanding. Also you can remove the first two fetch commands, the while loop should wrap the actual table cols, you want the table header only once, so use mysqli_fetch_fields out of your loop. We're not here to write your code :)
–
Michel FeldheimDec 1 '12 at 10:07