izbryte Posted December 18, 2010 Share Posted December 18, 2010 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,. 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.... Quote Link to comment https://forums.phpfreaks.com/topic/222024-getting-info-from-2-tables/ 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.