I fetch an array with todo titles and due dates from MySQL. I want to order it by date and have the oldest on top. But there are some todos without a date. These todos I don\'t
You can do it in MySQL with the ORDER BY clause. Sort by NULL first, then the date.
ORDER BY
NULL
SELECT * FROM your_table ORDER BY (date_column IS NULL), date_column ASC
Note: This assumes rows without a date are NULL.