Ok, maybe I am just overlooking something simple here but im tired and my brain can't get round this little problem I need to solve.
I have two database tables (blog and exchange), setup like so. The blog table has all the typical usual stuff (id, title, description) etc. The exchange table stores the id of the blog that requested the exchange and the id of the blog that has been requested, plus an enum for checking if the exchange has been accepted/declined/cancelled.
This works fine for reciprocal link building but now I want to do three-way link exchanges for pure one-way organic backlinks. The SQL query will need to select all partners of a blog from the exchange table, then fetch all that blog's partners if that other blog is also linked with the first blog. I have been trying different queries but no luck. I can't seem to get my head around it and I don't know why, maybe tiredness.
I hope I am making sense here. Any help with the query be greatly appreciated.
The exchange table simply has ID, BLOG_ID (the blog), BLOG_EXCHANGE_ID(the blog that made the request).
I have two database tables (blog and exchange), setup like so. The blog table has all the typical usual stuff (id, title, description) etc. The exchange table stores the id of the blog that requested the exchange and the id of the blog that has been requested, plus an enum for checking if the exchange has been accepted/declined/cancelled.
This works fine for reciprocal link building but now I want to do three-way link exchanges for pure one-way organic backlinks. The SQL query will need to select all partners of a blog from the exchange table, then fetch all that blog's partners if that other blog is also linked with the first blog. I have been trying different queries but no luck. I can't seem to get my head around it and I don't know why, maybe tiredness.
I hope I am making sense here. Any help with the query be greatly appreciated.
The exchange table simply has ID, BLOG_ID (the blog), BLOG_EXCHANGE_ID(the blog that made the request).
Last edited:







