I have a table that among several fields has the following two:
and
I need to be able to query something like this except I need to be able to get the last item that was updated and if none is available or has NULL as default value get the one that was last posted:
SELECT *
FROM t1
WHERE ID = ".$myid."
ORDER BY item_posted ASC LIMIT 1
How do I perform that check on the fly?