I have searched around and came up with nothing.
I have 2 tables and to not have to query the database for every post that shows i need to join them somehow.
I want to get the url
from the pics table that have the id of the pics
field in posts table. Now heres my problem: the pics
field is a commma separated "list" (4,1 or 32,4,32,2), because every post usually have more than one picture.
Table set ups:
posts:
id | header | text | pics
| 1 xxx xxx 3,1
| 2 xxx xxx 2,10,4
| 3 xxx xxx 16,17,18,19
| 4 xxx xxx 11,12,13
pics:
id | name | url
| 1 xxx xxx
| 2 xxx xxx
| 3 xxx xxx
| 4 xxx xxx
| 10 xxx xxx
| 11 xxx xxx
| 12 xxx xxx
| 13 xxx xxx
| 16 xxx xxx
| 17 xxx xxx
| 18 xxx xxx