Mysql select任意一行FROM table_one具有相同值的WHERE列多次出现,然后从一个数组中的table_two输出它们的数据

Doesn't matter how many times a user_id appears in table_one, I just need select any of their user_ids e.g select any of (user_id = 8 and user_id = 12) then get their names and age from table_two then add them into an array. Here are the tables:

table_one:

id   user_id   user_loves
1      8       Mango
2      5       Apple
3      1       Oranges
4      12      Toys
5      8       Guns
6      12      Bats

table_two:

id   user_id    name      Age
 1      8       David     19
 2      5       Michael   24
 3      12      Elsa     22
 4      4       Greg      26

Get any of user_id = 8 AND user_id = 12; then fetch the corresponding names and age from table_two and populate the result into an accessible array like so:

$result = array();
firstname = $result[0][name];
second_age - $result[1][age];

So that my final answer is

firstname = David
secondName = Elsa
second_age = 22

you could use a select distinct and left join

select distinct t1.user_id, t2.name,  t2.age 
from table_one t1
left join table_two t2 on t1.user_id = t2-user_id