It's called an Alternative Syntax For Control Structures. You should have an endwhile; somewhere after that. Basically, it allows you to omit braces {} from a while to make it look "prettier"...
As far as your edit, it's called the Ternary Operator (it's the third section). Basically it's an assignment shorthand.
$foo = $first ? $second : $third;
is the same as saying (Just shorter):
if ($first) {
$foo = $second;
} else {
$foo = $third;
}