i get multidimensional array from channel table
$sql_channels = get channel sql
$channels = $sql_channels->fetchAll();
and i want add video in each channel :
foreach($channels as $key=>$channel)
{
$sql_product = get video sql
$product = $sql_product->fetchAll(PDO::FETCH_ASSOC);
$channels[$key]['videos'] = $product;
}
but only first channel have video and after second channel['video'] is empty!!! out put like this:
Array
(
[0] => Array
(
[chanel_title] => test0
[vedios] => Array
(
[0] => Array
(
[id] => 23
)
)
)
[1] => Array
(
[chanel_title] => test1
)
[2] => Array
(
[chanel_title] => test2
)
[3] => Array
(
[chanel_title] => test3
)
[4] => Array
(
[chanel_title] => test4
)
)
all channels contain one video . i add 'image' with this method to channel array and work fine but video not work.