I have a friends script, I need to display this user's friend’s page. There is a database frnds
, and in it the fields id
, user_one
, user_two
. There is a page http://test1.ru/friends/?id=1 there everything shows perfectly, and on http://test1.ru/id1 it shows all users of the same friend.
<?php ... $query = "SELECT user_one, user_two FROM frnds WHERE user_one = '$myrow2[id]' OR user_two = '$myrow2[id]'"; $frnd_query = mysql_query($query); while ($run_frnd = mysql_fetch_array($frnd_query)){ $user_one = $run_frnd['user_one']; $user_two = $run_frnd['user_two']; if ($user_one == $myrow2['id']) { $id = $user_two; } else{ $id = $user_one; } $username = getuser($id, 'username'); $family = getuser($id,'family'); $avatar = getuser($id,'avatar'); echo "<a href='/id$id'><div id='textop'>$username $family</div> "; echo "<img src='/".$avatar."' width=110px border=0px><br/></a>"; } ?>