Can anyone tell why this doesn't work?
<?php
if ($totalRows_rsSection >0 && $pixID == ""){
if ($numOfCells ==1){
//echo "<br>";
echo '<table width="535" border="0" cellpadding="0" cellspacing="0">';
$numbOfRows = 1;
$numbCellsFilled = 1;
}
while($row_rsSection = mysql_fetch_assoc($rsSection)){
if ($numbOfRows == 1){
echo '<tr>';
$numbOfRows = 0;
}
$fileName = $row_rsSection["fileName"];
$location = $row_rsSection["path"];
$picID = $row_rsSection["imgID"];
$sectID = $row_rsSection["sectionID"];
if ($numbCellsFilled <= 3){
createThumbNail($picID, $self, $sectID, $location, $fileName);
$numbCellsFilled++;
}
elseif($numbCellsFilled ==4){
createThumbNail($picID, $self, $sectID, $location, $fileName);
echo '</tr>';
$numbCellsFilled = 1;
$numbOfRows = 1;
}
$numPicsID = array($picID);
}
foreach($numPicsID as $value){
echo "num pics ID: ".$value."<br>";
}
echo '</table>';
}
?>
My question is why when I have this, $numPicsID = array($picID);, as show above, only the last item is store in array. However, if I put this same code, $numPicsID = array($picID);, in the function, createThumbNail($picID, $self, $sectID, $location, $fileName);, then the array does store all of the items. Should either case be working? All I care is so I can get all the items into the array and access that variable from other place on the page.
ljCharlie