Jump to content

getting info from 2 tables


izbryte

Recommended Posts

table one has a field titled friends which holds the member's id and a list of the member's friend's id #'s in csv format (i.e. 1,4,5,7,8).

table two has info about all members (such as id, nickname, photo, etc).

 

I'm trying to access the friend list of a particular member (table 1) and then access those friend's info.

Here's what I have but I'm getting an error:

 $friend_list = mysql_query("SELECT `friends_id` FROM `friends` WHERE `user_id`=".$_SESSION['userid']." LIMIT 1");
					 $friend_list = mysql_query("SELECT `user_id`,`hs`,`photo`,`photo_status`,`username` FROM `users` WHERE `user_id` IN (".substr($friend_list,0,-1).")") or die(mysql_error());

 

(friends_id will be the user_id of a member)

Please tell me if I'm not making sense....

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.