Help w/Joins PLZ

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
justravis
Forum Commoner
Posts: 53
Joined: Mon Dec 16, 2002 3:18 am
Location: San Diego, CA
Contact:

Help w/Joins PLZ

Post by justravis »

TABLES

Author
id
first
mid
last
credid

Credential
id
name

art_authartid
authid
rank

QUERY
SELECT author.id, author.first, author.mid, author.last, credential.name,
FROM author, credential WHERE art_auth.artid=$artid AND art_auth.authid=author.id AND credential.id=author.credid ORDER BY art_auth.rank DESC

ERROR
MySQL said:

You have an error in your SQL syntax near 'FROM author, credential, art_auth WHERE art_auth.artid=2 AND art_auth.authid=aut' at line 1

PLEA
I'm slightly new to sql. Any help would be greatly appreciated.[/u]
User avatar
mydimension
Moderator
Posts: 531
Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:

Post by mydimension »

remove the comma after credential.name
Post Reply