Sorry this may have been my poor explanation – I am trying to get a recordset loop to send multiple attachments. The only way I can get the loop to work is if the attachments are stored within the same folder as the PHP file but this gets a little messy for storage and I'd rather have them stored in a dedicated folder. I've attached 2 files to illustrate one which works (single recordset) and another which doesn't (recordset loop).
working.php – If you look at line 122 this method works but (obviously) only sends one attachment.
not-working.php – I have updated the MYSQLi recordset on line 34 to include the path using CONCAT (as suggested at the top of this thread) and then used the recordset loop function on line 122 but no files get attached. My thoughts are that the issue is with the CONCAT method since I have added <?php echo($ALL_uploaded_PDF_files->getColumnVal("Attachment")); ?> to the email which is sent and it displays the relative link correctly. Therefore is the script actually looking for files named "../quotationfiles/filename.pdf" and not seeing this a relative link?
I could of course create maybe 5 separate recordsets and limit each one in turn i.e. 0,1 1,2 etc but this would only allow up to 5 attachments and there maybe a scenario where I need to attach more
Your help would be much appreciated.
I hope you are well and staying safe during this horrid time.