Jaynesh Posted July 12, 2011 Share Posted July 12, 2011 Hello I have three tables. users(user_id, username) posts(post_id, user_id, post) vote(post_id, up, down) I have joined vote(post_id) with posts(post_id) if post_id has 3 duplicate data, it will output my data 3 times. How do I make it so it only outputs once? Quote Link to comment https://forums.phpfreaks.com/topic/241753-removing-duplicates/ Share on other sites More sharing options...
ebmigue Posted July 13, 2011 Share Posted July 13, 2011 Add a DISTINCT clause in your select statement. Or better yet, define keys in your tables. Quote Link to comment https://forums.phpfreaks.com/topic/241753-removing-duplicates/#findComment-1242273 Share on other sites More sharing options...
fenway Posted July 14, 2011 Share Posted July 14, 2011 Why would it have duplicate data to begin with? Quote Link to comment https://forums.phpfreaks.com/topic/241753-removing-duplicates/#findComment-1242512 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.