I have a query to my database that returns to me an array every row of the database is an array,
$qr = DBRead('sales', "WHERE status = 1");
foreach ($qr as $position => $linha){
$vendas = $linha['cod_produto'];
var_dump($vendas);
}
This print for the sequential array
array (size=25)
'venda' => string '96' (length=2)
'cod_produto' => string '1; 2; 8' (length=7)
array (size=25)
'venda' => string '98' (length=2)
'cod_produto' => string '; 1; 2; 8' (length=9)
And so on, the more you record more arrays.
My question is I want to get the key cod_produto
and select its value and put it in a single string with all those concatenated values does anyone have an idea how to do this with php?