How do i insert multiple uploaded files names in one field, comma separated in the data??
That is one way.
Better is to create a related table containing the file names.
What i am trying to do is insert names of uploaded files into a single field in a database column
You can achieve it using arrays.
Different thing if you want to use S3 multiple upload component.
For this I did not solve the problem.
does it works with S3 upload component too?
I don’t really understand your question …
This is the file upload component. It uploads the files to your server and then using the join formatter you return all the uploaded file names in a comma separate list file1.jpg, file2.pdf, file3.jpg
If you have a question about a different component then start a separate topic and explain your question in details there.
How can i add results of a repeat in a single field?
Well… Check my explanation! It shows exactly this!
Your explanation works for upload action that isn’t inside of a repeat.
Records inside of a repeat are inserted multiple times (depending on how many times the values are returned).
Now i want to store those values in single field, instead creating new row for every entry
What is your purpose of putting the file names in one field? You won’t be able to do anything with the files such as download them, display them or whatever depending on file type?
Create a variable (array) and add each name at end of circle of repeat… once finished insert it in db.
Said that Teodor solution allow you to get more freedom in your operations
Then don’t put the file upload in repeat…
Or put the insert after the repeat. Maybe if you explain more detailed what exactly are you doing we will be able to help.
Thanks for your responses, I have decided to create a separate table for the images, i just need a brief explanation on how to insert multiple for keys in the image field of the product.
What exactly are you trying to do as it’s not clear?
- insert multiple images names in one database field / row
Or
- insert multiple rows, depending on the image count?
It’s really hard to understand your idea, in each of your posts you ask for different things. Can you please clarify?
I have an Image table .i want to insert multiple rows depending on image count, then insert the each row id as foreign keys in a single field in a products table
What's the purpose of this? Why store these in a single field? Are you sure you have your app / database logic correct?
Thanks for patience. I have multiple images for each products, I just want a way to be able to reference the images later
Then do it as Ben suggests. Store the product id for each image.
It's never a good idea to store things comma separated, instead of multi rows related to the product id.