Greetings,
as a MySql newbie I need your help… again…
What I want is to select all the users’ email addresses from a table ‘users’ if they have submitted a comment to a page. And I was thinking about this query :
SELECT users.user_email, users.user_name, comments.*
FROM users, comments
WHERE users.user_name = comments.sender_uname AND comments.page = '$page' AND comments.page_id = '$page_id'
ORDER BY comments.id ASC
BUT, if a user submitted more than one comment, an email notification will be sent more than once (as many times as the number of the user’s comments). How can I build a query to select a user’s email address just ONCE from the table ‘users’ if he submitted a comment?
Your help is highly appreciated!
Regards