[eluser]Mat-Moo[/eluser]
I'm trying to sort a database by added date and duration, so I'm using
Code:
$this->db->order_by('date_add(fromdate, INTERVAL duration DAY)');
However this is failing with
Code:
ORDER BY date_add(fromdate, `INTERVAL` duration DAY)
as you can see "Interval" is now quoted. If I take the failing sql and put in in phpmyadmin, removing the quotes around "Intverval" then it works as expected. I guess this is CI thinking that I have multiple fields in the order... so how can I get this to work as expected?
TIA