I'm messing around with a content management system called mArticle and basically what I'd like to do is create additional tables. I have some of it working but when it comes to the validation page where it looks to the 2 category tables, everything falls apart.
here's the select statement that I have so far. I'm getting a syntax error.
$unedited=$DB_ma->query("SELECT articlemain.*, articlereviews.* FROM articlemain, articlereviews WHERE (articlemain.isapproved=0) OR (articlereviews.isapproved=0) ORDER BY dateline DESC");
All its supposed to do is look to the 2 tables and pick out and display the ones with "isapproved=0".
Any ideas as to why I'm getting the syntax error. I attempted to ask the original author of the script about modifications but I don't think he's around anymore.
I would like to see the table structure. What you are attempting is a join query, but there is now where clause that tells the query upon which columns to perform the join. It should probably look something like this.
$unedited=$DB_ma->query("SELECT articlemain.*, articlereviews.* FROM articlemain, articlereviews WHERE (articlemain.ID = articlereviews.articleID) and ((articlemain.isapproved=0) OR (articlereviews.isapproved=0)) ORDER BY dateline DESC");
Assuming that there is a column in the articlereviews table name articleID that specifies that ID of the article for which that review was written.