SELECT @id :=
(
SELECT senderid
FROM mytable
WHERE receiverid = @id
) AS person
FROM (
SELECT @id := 5
) vars
STRAIGHT_JOIN
mytable
WHERE @id IS NOT NULL
SELECT @id :=
(
SELECT senderid
FROM mytable
WHERE receiverid = @id
) AS person
FROM (
SELECT @id := 5
) vars
STRAIGHT_JOIN
mytable
WHERE @id IS NOT NULL