Hi there,
The following query:
SELECT links.id, links.title, relatedlinks.id, relatedlinks.link_id, relatedlinks.shop_id FROM links, relatedlinks ORDER BY links.title ASC
Table 'links':
- id
- title
- link
Table 'relatedlinks':
- id
- link_id
- shop_id
It doesn't work quite the way it should though, and although I can see why, I can't see the fix.
The way this works, is that it retrieves all the links from the database, putting a tick in each checkbox where:
link.id == relatedlinks.link_id && relatedlinks.shop_id == $shop_id
Any ideas?
Thanks,
Chris