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 Quote Link to comment 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... Quote Link to comment 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 Quote Link to comment 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.. Quote Link to comment Share on other sites More sharing options...
zhshero Posted November 20, 2010 Author Share Posted November 20, 2010 but wouldn't that take longer? Quote Link to comment 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... Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
zhshero Posted November 20, 2010 Author Share Posted November 20, 2010 can anyone else help? Quote Link to comment 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> <? } ?> Quote Link to comment 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.