I have the following piece of code that I am having problems resetting the $row array. It's a nested loop, $row works the first time, then is blank on additional loops.
/**Setup local variables with passed data**/
$ing = $this->getVariable('ingredients');
$row = $this->getVariable('unitdrop');
$unit= $this->getVariable('unit');
/**Start Displaying data**/
if (!$ing) {print("No ing");}
else
{while ($i = $ing->fetch_array())
{
/**Display $ing Data**/
if (!$row) {print("No data row");}
else
{while($p = $row->fetch_array())
{
/**Display $row Data**/
}
}
reset($row); // <-- Does not reset $row to first record
}
$rowreturn the same data with every loop? Why not iterate it once and store inside an array?