Good afternoon, I'm starting on Codeigniter and would like some help.
I have a Soccer Times table. Each team has its players that are in another table of my bank.
I get the values of these two separate tables, but I would like to create only one array that would organize each team with their respective players.
Example:
Times (
[0] => Array
(
[id] => 1
[time_name] => 'Barcelona'
)
[1] => Array
(
[id] => 2
[time_name] => 'Real Madrid'
)
)
Jogadores (
[0] => Array (
[id] => 0
[time_id] => 2
[player_name] => 'Cristiano Ronaldo'
)
[1] => Array (
[id] => 0
[time_id] => 1
[player_name] => 'Lionel Messi'
)
So I would like to produce an array like this:
TimeCompleto (
[0] => Array (
[id] => 0
[time_name] => 'Barcelona'
Jogadores => Array (
[1] => Array (
[id] => 0
[time_id] => 1
[player_name] => 'Lionel Messi'
)
)
)
Thanks for the help right away.