yes, all you need is a join...
Code:
SELECT content.id
, content.views
, content.vote_rating
, content.category
, content.name
, content.actual_name
, content.date_added
FROM favourites
INNER
JOIN content
ON content.id = favourites.cid
AND (
content.name LIKE '%query%'
OR content.actual_name LIKE '%query%'
)
WHERE favourites.uid = 937
ORDER
BY content.vote_rating DESC LIMIT 0, 9
by the way, remove the id column from your favourites table --
Code:
CREATE TABLE favourites
( uid INTEGER NOT NULL
, cid INTEGER NOT NULL
, PRIMARY KEY ( uid , cid )
, FOREIGN KEY ( uid )
REFERENCES users ( id )
ON DELETE CASCADE
, FOREIGN KEY ( cid )
REFERENCES content ( id )
ON DELETE CASCADE
);
Bookmarks