0

Im building an app where a user can upload multiple images, the path will be stored in the database, but is there a way to put all the paths on a single column (an array type),Im kinda new to mysql and don't know if that exists.

I just want to avoid creating 10 or more columns for each image.

By writing this I realized I should make another table just for images, and link them.

Anyway I would still like to know if there is a way of creating arrays for a column in mysql.

Thank you.

  • yep, your conscience is tellin you the right thing, follow your gut. create another table. normalise them – Kevin Jul 29 '20 at 01:38
  • You could store them as a json and use json_encode and json_decode to write/read – Emre Koc Jul 29 '20 at 01:40
  • Tip: Since you're new to MySQL, try searching Stack Overflow for existing answers before posting a new question. Most basic questions are already answered, probably more than once. – Bill Karwin Jul 29 '20 at 01:45

0 Answers0