I've got a website that archives stories. When a user uploads a story, its info is added into a table: title, chapter, etc.
At the moment, the stories appear on the author's website in a list. Even stories with different chapter numbers appear separate.
I'd like to make an If statement to say, If there is more than one story with the same Title, simply list the story's chapter number next to the first entry. (Does that make sense?)
Example... right now:
Title Chapter
My story 1
My story 2
How I want it:
My story 1, 2
The code I've got going now is just a simple while.
$fics = mysql_query("SELECT * FROM archive WHERE author='$profile'",$db);
while ($myrow = mysql_fetch_array($fics)) {
printf("<tr><td align=\"center\">%s</td><td align=\"center\"><a href=\"archive/%s\">%s</a></td><td align=\"center\">%s/%s</td><td align=\"center\">%s</td><td align=\"center\">%s</td></tr><tr><td colspan=\"5\" align=\"right\"><span class=\"word\">%s</span></td></tr>", $myrow["title"], $myrow["fic"], $myrow["chap"], $myrow["genre"], $myrow["sub"], $myrow["mov"], $myrow["warn"], $myrow["summary"]);
}
How can I add this If statement?