Ik kom er niet uit!
Ik wil de resultaten uit mijn db in een multi. array opslaan. Het werkt allemaal goed alleen de fout zit hem wanneer ik de gegevens in de array stop. Weet iemand hier wat ik fout doe?
$i is de productgroep in vorm van 0 - 17
$a is bijvoorbeeld product1 van de productgroep $i
ik wil dus graag hebben:
$this->mProduct[0][1]['type'] en $this->mProduct[0][1]['naam'] enz
$this->mProduct[0][2]['type'] en $this->mProduct[0][2]['naam'] enz
$this->mProduct[1][1]['type'] en $this->mProduct[1][1]['naam'] enz enz.
class ProductenHuurLijst
{
public $mProduct;
public $mProductGroep;
public $mAantalProductGroepen;
public $mTempProducten;
public function __construct()
{
//had ook in init() ge kunt .
$this->mAantalProductGroepen = Catalogus::GetAantalProductGroepen();
}
public function init()
{
//Multideme. array
for($i=1; $i<count($this->mAantalProductGroepen); $i++)
{
$this->mTempProducten = Catalogus::GetProduct($i);
for($a=1; $a<count($this->mTempProducten); $a++)
{
$this->mProduct[$i][$a] .= $this->mTempProducten[$a];
}
print_r($this->mProduct);
}
}
}
?>
Dit is resulaat van print_r:
Array ( [1] => Array ( [1] => Array ) ) Array ( [1] => Array ( [1] => Array ) ) Array ( [1] => Array ( [1] => Array ) ) Array ( [1] => Array ( [1] => Array ) ) Array ( [1] => Array ( [1] => Array ) ) Array ( [1] => Array ( [1] => Array ) ) Array ( [1] => Array ( [1] => Array ) ) Array ( [1] => Array ( [1] => Array ) ) Array ( [1] => Array ( [1] => Array ) ) Array ( [1] => Array ( [1] => Array ) ) Array ( [1] => Array ( [1] => Array ) ) Array ( [1] => Array ( [1] => Array ) ) Array ( [1] => Array ( [1] => Array ) ) Array ( [1] => Array ( [1] => Array ) ) Array ( [1] => Array ( [1] => Array ) ) Array ( [1] => Array ( [1] => Array ) ) Array ( [1] => Array ( [1] => Array ) )
484 views