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 5945271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:39:28+00:00 2026-05-22T16:39:28+00:00

Ok on my website it displays the users friends but it doesn’t have their

  • 0

Ok on my website it displays the users friends but it doesn’t have their profile picture?

I have 2 databases. One is Users and that is were i save all the users details. the second database has if they are friends in it?

My question is how to get their profile pic from the users table .

p.s. the profile pic row is Proimg

this is my code

Tables

In the 2nd database i have the friends details
id Sender Receiver Accepted
1   bob   bill      1
2   fred  bill      3

Accepted:

1 means that they havent accepted or declined
2 means that they have accepted
3 means that they have declined

In the 1st table i have the users details…

id Fullname Password proimg    birthday
1   bill     ****     hi.jpg    1991-01-01
2   bob      ****     hello.jpg    1991-07-02
3   fred     ****     hey.jpg    1991-10-05
<?php

    $term = $fullname;
    $sql12 = mysql_query("select * from Friends where Reciver like '%$term%' or Sender like '%$term%'"); 
    $Friends = mysql_num_rows($sql12);

    $t=1;
    while($t<=$Friends)
      {
      while ($row = mysql_fetch_array($sql12))
        {
      If ($row['accepted'] == 2)
      {
      Echo '<img src="images/defaultprof.png" width="45px" height="45px"/>';   
      }
      else
    {
    $_SERVER['PHP_SELF'];
    }
    }
      $t++;
    }  
    ?>
  • 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-05-22T16:39:29+00:00Added an answer on May 22, 2026 at 4:39 pm

    You’d probably want to INNER JOIN the user data of the friends. This could be done like this: (based on made up tables ofcourse).

    SELECT f.*, u.proImg FROM friends AS f 
    INNER JOIN users AS u ON u.userID = f.friendID 
    WHERE f.userID = 1;
    

    Read entire JOIN syntax here.

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

Sidebar

Related Questions

Users have been able to log into my website using their Facebook account, but
When my website/web app displays a picture, I need to allow the users to
I have a website which checks users IP and if its from CA displays
I have a website that displays a mashup on Google Map. When I try
I have a website that allows users from around the world to submit profiles.
i have a website that displays all kind of info to the client. It
I have a simple MVC website that displays a jquery dialog for editing purposes.
I have created a website that works with different sessions and every users has
Does Facebook have an API method that displays the total number of users registered
My website images look blurry for users with retina displays. (For example, on the

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.