--EDIT-- Your picture helped. You can handle that at the SQL Level
SELECT Login.*, Location.* FROM Login LEFT JOIN Location ON Login.UUID=Location.UUID GROUP BY Login.UUID
Then the resulting data in PHP will already be correctly formatted.
Notice that I chose table
Login to drive the query, could have also chosen the
Location table. depends on the underlying structure