Username:
Password:
Remember me:
Register

Back to forum: Web Programming (HTML, JS, CSS, PHP, MySQL)


Search forums via Google


0 Users appreciate this thread.

"Proper" friends script?
Started by angelrulez7
(2014-03-29 05:26:33)
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? ^
a
 

Log in to submit a comment

This topic's ID: 68792

Back to forum: Web Programming (HTML, JS, CSS, PHP, MySQL)




Total registered users: 8321
New registered users today: 7
Newest registered user: ElegantVulpes

©  Copyright 2026 3DSPlaza. All Rights Reserved