Problem system - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem system (
/showthread.php?tid=597828)
Problem system -
Edw - 05.01.2016
Resolved..
Re: Problem system -
Vince - 05.01.2016
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 код:
SELECT friends.FriendID, users.username FROM friends INNER JOIN users ON friends.friendID = users.id WHERE AddBy = %d
Re: Problem system -
Edw - 05.01.2016
Quote:
Originally Posted by Vince
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 код:
SELECT friends.FriendID, users.username FROM friends INNER JOIN users ON friends.friendID = users.id WHERE AddBy = %d
|
I do not understand.
If you look all IDs correct, it was not the problem, improvise I mean directly into a table name and you have but the problem is that only show the first id by showing 0 at all, but still check them, they look 0 depending how many are in the table on that userid.
Re: Problem system -
Edw - 05.01.2016
Help me, please.
Re: Problem system -
Edw - 05.01.2016
Quote:
Originally Posted by Vince
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 код:
SELECT friends.FriendID, users.username FROM friends INNER JOIN users ON friends.friendID = users.id WHERE AddBy = %d
|
I tried like you said but still not working.