- Joined
- Aug 15, 2008
- Messages
- 489
- Reaction score
- 43
I've got an issue which I've been trying to solve, but my PHP knowledge isn't enough to solve it.
I have got 2 tables. banhammer_bans and banhammer_players.
Table banhammer_bans has this structure.
id, created_at, reason, expires_at, state, player_id, creator_id
Table banhammer_players has this structure.
id, name
So my issue is, that I want to be able to have a list on my website of the banned players, in the format "Username, Banned by, Ban date, Unban date, Reason".
So I'd have to somehow link player_id and creator_id with the id found in banhammer_players.
Here is something I've been trying, which I learned from the previous time I asked for something, but figured out it wouldn't work out so well.
Then I simply tried echoing the names and etc, but what I got was Username and Banned by having the exact same name.
I have got 2 tables. banhammer_bans and banhammer_players.
Table banhammer_bans has this structure.
id, created_at, reason, expires_at, state, player_id, creator_id
Table banhammer_players has this structure.
id, name
So my issue is, that I want to be able to have a list on my website of the banned players, in the format "Username, Banned by, Ban date, Unban date, Reason".
So I'd have to somehow link player_id and creator_id with the id found in banhammer_players.
Here is something I've been trying, which I learned from the previous time I asked for something, but figured out it wouldn't work out so well.
Code:
SELECT * FROM `banhammer_bans` INNER JOIN `banhammer_players` ON banhammer_bans.creator_id = banhammer_bans.id ORDER BY created_at DESC
Then I simply tried echoing the names and etc, but what I got was Username and Banned by having the exact same name.