I have a field in my database that stores a string of numbers, separated by commas. The numbers are IDs which correspond to values in another table. The idea is that instead of storing a comma separated string of words (requiring a large field) I store a comma separated list of ID numbers. The question is, how to convert that list into a list of words from the other database table.
To make more sense:
TABLE1 contains information for artist portfolios.
TABLE1.FIELDX is a VARCHAR which stores a list of ID numbers in the following format ",3,4,6,76,32,"
Each number corresponds to the artists specialist areas of work.
TABLE2 contains detail about those specialisms.
TABLE2.FIELDY is the ID number
TABLE2.FIELDZ is the full word description of that specialism
My script will fetch TABLE1.FIELDX, it then needs to convert that into a list of descriptions using TABLE2.FIELDY
My thought was to take TABLE1.FIELDX and convert it to an array and then for each value in the array it would look up the full word description in TABLE2.FIELDZ and append it to a new string
However, I have trouble working out how to do this with arrays