Well I\'m trying to write a simple car expense tracking program. I\'m a novice at best.
What I want to do is load the page and if no sort variable is declared, sort by mileage.
If there is a sort variable defined, sort by that column.
What I have:
if (!$sort) {
sort_mileage();
}
elseif ($sort==\"litres\") {
sort_litres();
}
However when the page first loads, $sort isn\'t defined and I get a parse error.
This can be witnessed here: http://www.cameronspencer.com/car_program/index.php
However, as soon as you click on a column header (and define a value for $sort) it works as it should.
So how can I check for $sort without getting the parse error?
Thanks.