In MySQL there is no concept of array, there are records (rows) and fields (columns). You want MySQL to return all data of one user in a single record? It is possible, using, say, GROUP_CONCAT
, but it is wrong — then why even need the second table, store all in one.
The correct way is the above query with INNER JOIN. In order to collect the data in one array, you will need to bypass the derived RecordSet in a loop through the records.