This topic is locked

Moving Attachment to record in another table

10/5/2023 5:26:51 AM
PHPRunner General questions
D
druck281 author

I have two tables that can both exist independently. Both include a 'text' field for attachments. If a record from Table A get approved, some of the data gets inserted into Table B. When that happens, I want the attachment from Table A to be moved to the new record in Table B.
I am okay with storing the actual attachment in the same physical location regardless of which table it belongs to. Looking at the MySQL table, it appears the reference to an attachment is stored as JSON data. Can I simply copy that JSON data from Table A to Table B? Do I not need the whole JSON string or just the file name?
Thanks!