Multidimensional arrays issue
Posted: Mon Oct 20, 2003 12:06 pm
Hi there can anyone help with this prog.
Its intended function is to build a multidimensional array of file details ( based on selected db record) which is then passed to a mailing function which attaches the aforementioned files to the mail. Everything works fine EXCEPT I only get one entry in my multidimensioned array. The code (please ignore hardcoded values I havent designed an interface yet!)
I do appreciate that the variable $file_array is being cleared out every iteration, but I dont understand how to APPEND the sub arrays into the main array.
Its intended function is to build a multidimensional array of file details ( based on selected db record) which is then passed to a mailing function which attaches the aforementioned files to the mail. Everything works fine EXCEPT I only get one entry in my multidimensioned array. The code (please ignore hardcoded values I havent designed an interface yet!)
Code: Select all
while ($row = $salehighlights->fetchrow ())
{
$file_array = array($counter=>array("file" => "../Images/Catalogue_Thmbs/365/365lot" . $rowї'LotNo'] . ".jpg", "mimetype" => "image/jpeg", "filename" => "365lot" . $rowї'LotNo'] . ".jpg"));
$message .= "Lot " . $rowї'LotNo'] . " " . $rowї'Decription'] . " SOLD FOR £" . $rowї'HammerPrice'] ."\n\n" ;
$counter = $counter + 1;
}