angelrulez7(2014-03-29 05:26:33)On SocialRing, the friend script is very stupid. Here it is basically. (I've recoded it off the top of my head for the sake of this)
TABLE friends:
userto
userfrom
verify
CODE:
[code=*php]
<?php
$friends = "SELECT FROM friends WHERE userto = '$username' AND verify = '1'"; // This may be wrong, I'm doing it off of the top of my head.
$query = mysqli_query(db(), $friends);
while($fr = mysqli_fetch_assoc($query)){
?>
<a href="/user/<?php echo $fr['userfrom']; ?>"><?php echo $fr['userfrom']; ?></a>
<?php
}
?>[/code]
My problem is, if someone accepts a friend request, it will only appear on the accepter's profile, not the sender's profile. I want to find a way for it to appear on both people's profiles. How would I do this?
Thanks in advance.
This post has been edited one or more times, the last time was: 2014-03-29 05:49:15
a
angelrulez7(2014-03-29 16:43:34)So you just have two "while" statements? ^
On SocialRing, the friend script is very stupid. Here it is basically. (I've recoded it off the top of my head for the sake of this)
TABLE friends:
userto
userfrom
verify
CODE:
[code=*php]
<?php
$friends = "SELECT FROM friends WHERE userto = '$username' AND verify = '1'"; // This may be wrong, I'm doing it off of the top of my head.
$query = mysqli_query(db(), $friends);
while($fr = mysqli_fetch_assoc($query)){
?>
<a href="/user/<?php echo $fr['userfrom']; ?>"><?php echo $fr['userfrom']; ?></a>
<?php
}
?>[/code]
My problem is, if someone accepts a friend request, it will only appear on the accepter's profile, not the sender's profile. I want to find a way for it to appear on both people's profiles. How would I do this?
Thanks in advance.
2014-03-29 05:49:15