Code: Select all
$query = ("SELECT * FROM products WHERE catid = :c AND pause = 'off' ORDER BY rcstock, comingsoon DESC, $order LIMIT $offset, $rowsPerPage");At the moment comingsoon is all appearing at the top for some reason, probably because rcstock doesn't have anything in it.
So how do I do the ORDER BY so rcstock ASC comes first, then comingsoon = NULL comes at the end?
I've tried this as well, but it doesn't work.
Code: Select all
$query = ("SELECT * FROM products WHERE catid = :c AND pause = 'off' ORDER BY if(comingsoon = '' or comingsoon is null,1,0), rcstock ASC LIMIT $offset, $rowsPerPage");