Hi all
Im having a little issue with my query, and wondered if
anyone could assist
My query draws all messages made on a particular song, and
also drags out any comments made about those specific messages
<cfquery name="explained"
datasource="#APPLICATION.DataSource#">
SELECT name_usr, date_msg, content_msg, id_usr, id_msg,
hot_msg, not_msg, username_msg, photo_usr, idmsg_msg, message_com,
username_com, date_com, id_com, COUNT(message_com) as comma
FROM (user_usr
LEFT OUTER JOIN messages_msg
ON user_usr.id_usr = messages_msg.id_usr_msg)
LEFT OUTER JOIN song_com
ON messages_msg.id_msg = song_com.id_msg_com
WHERE id_sng_msg= '#id_sng.id_sng#'
AND content_msg IS NOT NULL
GROUP BY id_com
ORDER BY (hot_msg-not_msg) DESC
</cfquery>
Here messages_msg is the table which contains messages made
about a song,
And song_com is the table that deals with any comments made
about those specific message..
If you see here, you can see how you can show/hide any
comments made about a message..
http://www.musicexplained.net/s/songs.cfm?a=jeff+buckley&s=Everybody+Here+Wants+You
In the query, i am counting how many comments are made about
a specific message "COUNT(message_com) as comma", and then placing
this on the page to display how many....
"show/hide #comma# comments on the message below....."
However, if you look at the link above again, when you click
to display comments for the second message "I dont even know which
Bucks tune this is. Any chance uploading the vid link?"..three
comments are displayed, but #comma# is only equal to 1....not 3
wondering where im going wrong..
hope this makes sense..
thanks