I should have posted my code. Will that solution work into this somehow?
while (!$recordSet->EOF)
{
$caption = make_db_unsafe ($recordSet->fields[caption]);
$thumb_file_name = make_db_unsafe ($recordSet->fields[thumb_file_name]);
$file_name = make_db_unsafe ($recordSet->fields[file_name]);
$imageID = make_db_unsafe ($recordSet->fields[ID]);
$image_description = make_db_unsafe ($recordSet->fields[description]);
// gotta grab the image size
$imagedata = GetImageSize("$config[listings_upload_path]/$file_name");
$imagewidth = $imagedata[0];
$imageheight = $imagedata[1];
$shrinkage = $config[thumbnail_width]/$imagewidth;
$displaywidth = $imagewidth * $shrinkage;
$displayheight = $imageheight * $shrinkage;
echo " Picture[$Icount] = ' $config[listings_view_images_path]/$file_name '; ";
echo " PictureLink[$Icount] = 'viewimages.php?imageID=$imageID&type=listing'; ";
echo " Caption[$Icount] = \" $caption \"; ";
echo " CaptionFull[$Icount] = \" $image_description \"; ";
$Icount = $Icount + 1;
$recordSet->MoveNext();
} // end while
} // end if ($num_images > 0)
}// end function getArray
// slide show
function getImageLink($listingID){
global $conn, $lang, $config, $style;
// grab the images
$listingID = make_db_extra_safe($listingID);
$sql = "SELECT ID, caption, file_name, thumb_file_name, description FROM " . $config[table_prefix] . "listingsImages WHERE (listing_id = $listingID) ORDER BY rank";
$recordSet = $conn->Execute($sql);
if ($recordSet === false)
{
log_error($sql);
}
$num_images = $recordSet->RecordCount();
if ($num_images > 0)
{
$Icount = 1;
while (!$recordSet->EOF)
{
$caption = make_db_unsafe ($recordSet->fields[caption]);
$thumb_file_name = make_db_unsafe ($recordSet->fields[thumb_file_name]);
$file_name = make_db_unsafe ($recordSet->fields[file_name]);
$imageID = make_db_unsafe ($recordSet->fields[ID]);
$image_description = make_db_unsafe ($recordSet->fields[description]);
// gotta grab the image size
$imagedata = GetImageSize("$config[listings_upload_path]/$file_name");
$imagewidth = $imagedata[0];
$imageheight = $imagedata[1];
$shrinkage = $config[img_width]/$imagewidth;
//$displaywidth = $imagewidth * $shrinkage;
//$displayheight = $imageheight * $shrinkage;
$displaywidth = $imagewidth;
$displayheight = $imageheight;
if ($Icount < 2)
{
echo " <center><a href=\"javascript:control('F');\"> ";
echo " <img name=PictureBox border=0 src= \"$config[listings_view_images_path]/$file_name\" height=\"$displayheight\" width=\"600\"></center> ";
}
$Icount = $Icount + 1;
//if ($Icount == 3)
//{
//echo "Register";
//}
$recordSet->MoveNext();
} // end while
} // end if ($num_images > 0)
}// end function getArray