Stevebenson223
Member
I need to copy several elements from one list to another list. I'm doing this by using 2 php form plugins in List 1: one on "New" to create a record in List 2 and one on "Edit" to update the record in List 2 if the record in List 1 is updated. This works for all elements except one: a fileupload element for an image. I'm using the same code $mydb->setQuery ("INSERT INTO events VALUES(... for each element and they all copy correctly into the respective database columns except the fileupload element, which is empty.
I've Googled about MySQL escape characters but can't find a definitive answer on whether the leading "/" is causing a problem and what to do about it.
I've tried using the Upsert form plugin but this creates a new record in List 2 when the List 1 record is updated. Also, while the Upsert plugin correctly copies the fileupload element file path into the database column for List 2, it displays in the list as the image icon and the file path, as if the image couldn't be found. Could this be because the file paths are different for the two lists?
(I've also tried using a list join but there are elements in List 2 which don't exist in List 1 and vice versa, so I couldn't get this to display correctly. There are other reasons too, related to custom links to details.)
Is there a way to copy the image from one folder to another using the php form plugin?
I've Googled about MySQL escape characters but can't find a definitive answer on whether the leading "/" is causing a problem and what to do about it.
I've tried using the Upsert form plugin but this creates a new record in List 2 when the List 1 record is updated. Also, while the Upsert plugin correctly copies the fileupload element file path into the database column for List 2, it displays in the list as the image icon and the file path, as if the image couldn't be found. Could this be because the file paths are different for the two lists?
(I've also tried using a list join but there are elements in List 2 which don't exist in List 1 and vice versa, so I couldn't get this to display correctly. There are other reasons too, related to custom links to details.)
Is there a way to copy the image from one folder to another using the php form plugin?
Last edited: