The query is probably working right, but your loop is definitely wrong.
$Eventa=$row_wentto['Event.event'];
$Eventb=$row_wentto['Attendance.event'];
These are outside the loop; their values inside the loop will never change.
Incidentally, your code assumes that there will always be at least one record returned. What happens if there isn't? You'll get a line of bogus information. Consider using a while(){} loop instead of a do{}while().
And, also, that X should be in quotes and you don't really need the echo if you're not going to echo anything (but that's a parse error so I'm going to guess that this isn't quite the genuine code).