I don't use the ternary operator very often, but I think the question mark is required.

$ad = (isset($_GET['ad']) && $_GET['ad'] == 'desc') ? 'desc' : 'asc';

wooowooo

12-28-2007, 02:42 PM

Spot on, quick one though - do you know why only the first letter from the heading is being displayed and not the whole heading as was happening before I edited the code to sort assending and desending?

Many thanks

arnyinc

12-28-2007, 03:01 PM

Nothing jumps out at me as something that would cause that specific problem. I would do a view source to verify the HTML is right or wrong. Then verify your SQL statement is returning exactly what you expect. Then you can limit it to your PHP causing the issue.