Saturday, 28 September 2013

mySQL joined tables no duplicates

mySQL joined tables no duplicates

I have two tables: One table contains poetry submitted by members. The
other is the member's table. Both tables contain The Member's ID (MID and
SubMID). I want to display the last 15 poems that have been updated.
However, I want to display ONLY one work for any one author.
This works but it if an author updates a few works then they get displayed
many times:
$query="SELECT * FROM submits, members WHERE submits.SubMID = members.MID
AND submits.sub_approved = 'T' ORDER BY submits.sub_Last_Update DESC LIMIT
15 ";
You can see the results of that query here in the rolling marquee on the
right: http://www.Prose-n-Poetry.com
The problem is that one author can take over the marquee by updating a few
poems.

No comments:

Post a Comment