php - Get related rows in one table using a table with relations -
i have 2 tables. 1 stores content records, other 1 stores relations between content-records. table "content" table "relations" +---+-----+------+------+ +---------+----------+ |id |num |text |value | |id_local |id_foreign| +---+-----+------+------+ +---------+----------+ |1 |111 |aaa |12345 | |2 |3 | +---+-----+------+------+ +---------+----------+ |2 |222 |bbb |23456 | |2 |5 | +---+-----+------+------+ +---------+----------+ |3 |333 |ccc |34567 | |4 |1 | +---+-----+------+------+ +---------+----------+ |4 |444 |ddd |45678 | |2 |1 | +---+-----+------+------+ +---------+----------+ |5 |555 |eee |56789 | |3 |6 | +---+-----+------+------+ +---------+----------+ |6 |666 |fff |67890 | |4 |5 | +---+-----+------+------+ +---------+----------+ reading table "relations"