paulnaj wrote:
Th error is just a typo ... the second '?' should be a ';'
Actually, it should be a ':'. :p
Once you get used to the ternary operator (and don't type it wrong), you'll find yourself using it all the time for that sort of thing. It's really quite simple, and is very similar to, for example, an IF function in SQL, where if the first value is true, you use the 2nd value, otherwise you use the 3rd:
IF(col1 = 5, 'value1', 'value2')