Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9280901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:59:07+00:00 2026-06-18T17:59:07+00:00

I am developing a social website.I have an option called alerts which shows pending

  • 0

I am developing a social website.I have an option called alerts which shows pending friend requests and unread messages.My query is following:

SELECT
  sk_friends.frndship_from_user_id,
  sk_messages.msg_from_user_id,
  sk_messages.msg_text,
  sk_messages.msg_date 
FROM
  sk_friends INNER JOIN sk_messages
WHERE 
  sk_messages.msg_to_user_id = '$user_id'
  AND sk_friends.frndship_to_user_id ='$user_id'  
  AND sk_friends.frndship_status = 'pending'
  AND sk_messages.msg_status='unread'
ORDER BY 
  sk_friends.fndship_date ASC,
  sk_messages.msg_date ASC;
  • sk_friends and ak_messages are tables.
  • msg_from_user_id is the id of sender
  • frndship_from_user_id is the id of the user who sends the request
  • $user_id is the id of the login user

Each row data is appearing twice. I dont know why does it happen.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T17:59:09+00:00Added an answer on June 18, 2026 at 5:59 pm

    Your inner join does not have an ON clause. Try adding one, that should remove double results.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a social website like facebook in php. I have a page
I’m developing a website which allows users to join with GFC (Google Friend Connect).
we are currently developing a website which will heavily involve connections to several social
I am developing an application which schedules messages to post on social media on
I am developing a feature for my social networking website that allows users to
We are developing something like a social networking website. I've got task to do
I have an idea of a social network website and I will be working
I'm currently developing a large site that handles user registrations. A social networking website
I am in the middle of developing a PHP social media web application which
Hi I am developing social networking website and need a suggestion. I am using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.