3
This error is coming to me and I’m not getting why. The line of code is as follows:: $matrix(0, $key)=$quantidade['id_product'];
The complete function is as follows:
public function sumQuantidadesPorProduto() {
$quantidades = $this->getAllQuantidadesLocais();
$sum = 0;
$matrix = array();
foreach ($quantidades as $key => $quantidade) {
$sum+=intval($quantidade['quantidade']);
$matrix(0, $key) = $quantidade['id_product'];
$matrix(1, $key) = $sum;
}
return $matrix;
}
I can’t believe I didn’t even notice it, and the problem is I had it earlier ahah Many hours already programming... thank you, hug!
– Vítor Sá