zhshero Posted November 19, 2010 Share Posted November 19, 2010 I'm trying to make it so i can show the friends i added, or users that added a friend <table border=2 width="250" height="125"><tr> <?php $userfinal = get_username($_SESSION['user_id']); $Members = mysql_query("SELECT * FROM friends WHERE username='$userfinal' AND friendname"); $numRowsMembers = mysql_num_rows($Members); for($count = 1; $count <= $numRowsMembers; $count++) { $name = mysql_fetch_array($Members); ?> <td width="150" height="125"> <a href="view_profile.php?username=<? echo $name['friendname']?>"><img src="<? echo $name['main_P']?>" width="100" height="100"/> <? echo $name['friendname']?></a> <? if (isset($name['date']) && (time() - $name['date'] > 300)) { echo 'offline =['; } else { echo "<font color=green>[Online Now!]</font>"; } $name['date'] = time(); // update last activity time stamp ?> </td> <? } ?> </tr></table> database id friendname username 12 kristybellexo zhshero 13 demo zhshero 14 zhshero zhshero Link to comment https://forums.phpfreaks.com/topic/219252-help-showing-friends-added/ Share on other sites More sharing options...
trochia Posted November 19, 2010 Share Posted November 19, 2010 Based on time? (when added)? How deep will you drill down? LOL... Link to comment https://forums.phpfreaks.com/topic/219252-help-showing-friends-added/#findComment-1136991 Share on other sites More sharing options...
zhshero Posted November 19, 2010 Author Share Posted November 19, 2010 i just want it to show all the friends i ever added, but not based on time i want to be able to go to someone else profile and see who there friends are and they can do the same Link to comment https://forums.phpfreaks.com/topic/219252-help-showing-friends-added/#findComment-1136994 Share on other sites More sharing options...
trochia Posted November 20, 2010 Share Posted November 20, 2010 Well, what I would do? Is simply go to google and do a search for: a) "open source facebook clone" b) Install it? c) And see how it's done !! There are many available..and that would be your best approach I feel from my standpoint.. Link to comment https://forums.phpfreaks.com/topic/219252-help-showing-friends-added/#findComment-1136995 Share on other sites More sharing options...
zhshero Posted November 20, 2010 Author Share Posted November 20, 2010 but wouldn't that take longer? Link to comment https://forums.phpfreaks.com/topic/219252-help-showing-friends-added/#findComment-1136997 Share on other sites More sharing options...
trochia Posted November 20, 2010 Share Posted November 20, 2010 Take Longer than what? From the sound of your post...you are trying to do, what has already been done? So, that's what I would do? :-) Why reinvent the wheel...is what I am trying to convey... Link to comment https://forums.phpfreaks.com/topic/219252-help-showing-friends-added/#findComment-1136998 Share on other sites More sharing options...
zhshero Posted November 20, 2010 Author Share Posted November 20, 2010 to do what you are telling me to do, is i have to download the script install it find where the friends is and take from there but i would have to upload it to my web host, and then unzip the files, witch i have no clue how to do with my *** web host Link to comment https://forums.phpfreaks.com/topic/219252-help-showing-friends-added/#findComment-1137000 Share on other sites More sharing options...
zhshero Posted November 20, 2010 Author Share Posted November 20, 2010 can anyone else help? Link to comment https://forums.phpfreaks.com/topic/219252-help-showing-friends-added/#findComment-1137050 Share on other sites More sharing options...
zhshero Posted November 21, 2010 Author Share Posted November 21, 2010 ok nvm i got what i needed <? $Members = mysql_query("SELECT * FROM friends WHERE username='$Username'") or die(mysql_error()); $numRowsMembers = mysql_num_rows($Members); ?> <?php for($count = 1; $count <= $numRowsMembers; $count++) { $name = mysql_fetch_array($Members); ?> <? echo $name['friendname']?></a> <? } ?> Link to comment https://forums.phpfreaks.com/topic/219252-help-showing-friends-added/#findComment-1137328 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.