There is a database with two tables users (user_id, email, password, user_type) and user_profiles (user_id, profile_key, profile_value). Stored in them, respectively, the primary user and secondary data (gender, phone, address, etc.) Need to make their Union funds only SQL to output to be one array:
array {
["user_id"]=> "1"
["username"]=> "recky"
["password"]=> qwerty
["user_type"]=> "admin"
["sex"] => "iAdmireIt"
["hobbie"] => "playing tambourine"
}
If you do "SELECT `u`.*, `up`.* FROM `users` AS `u`
INNER JOIN `users_profile` AS `up`", the output I get 2 array with fields profile_key and profile_value with different values in each.
Is it possible with SQL to implement this? And how?