[eluser]Robb__[/eluser]
I'm having trouble getting this to work.
Fist, I save information to theese arrays;
Code:
$data['Image'][$i] = $resultrow2[$i] ->Image; // {../Images/test.jpg, ../Images/test2.jpg, ../Images/test.jpg)
$data['Name'][$i] = $resultrow3[$i] ->productName; //{"one", "two", "three"]
$data['Price'][$i] = $resultrow4[$i] ->Price; // {10,20,30)
$data['Desc'][$i] = $resultrow5[$i] ->Description; // {"first one, second, third"}
Code:
$this->load->view('index',$data);
Then in my index.php I want to retrieve this information, but it doesn't work?
Code:
<?php for ($i=0; $i< $5; $i++): ?>
<img src="<?=${"Image$i"};?>" onclick="showImage(<?=${"Name$i"};?>,<?=${"Price$i"};?>,'<?=${"Desc$i"};?>'); alt=""/></a>
<?php endfor; ?>