Sorry, I was just doing those queries to show you how the data was stored. The comment script was made by someone else - I'm just trying to incorporate in to my news script.
SELECT A.sid, A.title, A.time, A.bodytext, A.author, A.url FROM news
A INNER JOIN (SELECT sid FROM news WHERE approved=1 ORDER BY sid desc LIMIT $start, $limit)
B USING (sid)
I was told this above code would be more efficient once I had a lot of news entries.
My news script gets it's information from the 'news' table in the 'news' database.
I need to match my "sid" column in the 'news' table with "page_id" (from the 'comments' database, 'pages' table) to grab it's unique "id".
Once I have the 'id', I need to query 'page_id' (from the 'comments' database, 'comments' table) and count(*) the results - where is_approved = 1
I hope that clears things up. I realize it's a stupid setup, but I didn't design it that way. I was just hoping I could work with it.