15.06.2016, 00:51
There's no need for 2 queries. You can write a JOIN statement based on the user id.
PHP Code:
SELECT
tickets.*,
spieler.name AS username
FROM
tickets
INNER JOIN
spieler ON spieler.id = tickets.userid
WHERE
tickets.status=0