Trying to change from old ADDT to MySQLi coding to show image if file exists in folder
Hi, I'm trying to bring some old code up to date so have managed to sort out most of the code block but I can't quite get my head around the dynamic file name structure bit so can anyone help please?
Recordset is Rsi_pages and page_photo1 is the database field name where the image name is stored as it's created dynamically when the image is uploaded.
Obviously it has changed to $Rsi_pages->getColumnVal("page_photo1") in the new version but I'm getting a bit lost at how that carries over into the required line of code.
Alternatively, is there a better way to do this?
Old code
<?php
// Show If File Exists (photo1)
if (tNG_fileExists("uploads/images/pages/", "{Rs_pages.page_photo1}")) {
?>
<div align="center">
<img src="<?php echo tNG_showDynamicImage("", "uploads/images/pages/", "{Rs_pages.page_photo1}");?>" alt="<?php echo $row_Rs_pages['page_photo1_caption']; ?>" /><br />
<span class="photocapt"><?php echo $row_Rs_pages['page_photo1_caption']; ?></span>
</div>
<?php }
// EndIf File Exists (photo1)
?>
New Code
<?php
// Show If MySQLi File Exists (photo1)
if (fileExists("uploads/images/pages/", "{Rs_pages.page_photo1}")) { // <--- what do I change this line to?
?>
<div align="center">
<img src="uploads/images/pages/<?php echo($Rsi_pages->getColumnVal("page_photo1")); ?>" alt="<?php echo($Rsi_pages->getColumnVal("page_photo1_caption")); ?>" /><br />
<span class="photocapt"><?php echo($Rsi_pages->getColumnVal("page_photo1_caption")); ?></span>
</div>
<?php }
// EndIf MySQLi File Exists (photo1)
?>
Thanks