05.01.2016, 16:22
(
Последний раз редактировалось Edw; 06.01.2016 в 22:22.
)
Resolved..
SELECT friends.FriendID, users.username FROM friends INNER JOIN users ON friends.friendID = users.id WHERE AddBy = %d
The extra id column is not really necessary. The row can be uniquely identified by the two userids.
If you want to display the current friends with their name then you should probably use a join. The above approach may be viable if or when prepared queries are added to the MySQL plugin, but for now it's probably too intensive on the server. The query should look somewhat like this: PHP код:
|
The extra id column is not really necessary. The row can be uniquely identified by the two userids.
If you want to display the current friends with their name then you should probably use a join. The above approach may be viable if or when prepared queries are added to the MySQL plugin, but for now it's probably too intensive on the server. The query should look somewhat like this: PHP код:
|