The problem is that you seem to use a relational database in a way it is not meant for. The table recommendations violates the condition of the so-called first normal form. I recommend to split it into two tables: