This is my code
$teid = $_GET['catid'];
// list all articles found
$result = @mysql_query("SELECT authorid, article, articletitle, dateadded, authorid FROM articles, authors WHERE articles.id=" . $teid . " AND authorid=authors.id");
I tried many things and it keeps giving me this error
Error performing query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND authorid=authors.id' at line 1
now just to give you a background on what's happening
i have two tables...as u can see. articles and authors
the tables look similar to this
articles
======
id | article | authorid
======
authors
======
id | name | email
basically..i want the query to grab the article id from the previous page [saved in the url], and then get the authorid in the same entry, and use the to set the authors id.
if i ONLY put authorid=authors.id, it works, but then it just lists every article...yes it does it in order of authors, which is fine, but i only want the article of the id given..how do i do that?