I have table with columns
text TEXT,
date DATETIME NOT NULL,
id INT AUTO_INCREMENT NOT NULL.
Earlier, in search script search.php I used the next SQL statement:
SELECT * from table WHERE (id>$id) && (text LIKE '%$text%') ORDER BY id DESC LIMIT 10;
"next" link was <a href="search.php?id=$id">
But now, I have to order search results by date. The problem is that field 'date' can be modified in other scripts. So i can not order by id. Also some rows possibly have the same date. So I can not use
SELECT * from table WHERE id>$id ORDER BY date DESC LIMIT 10;
What I should do?
Thank you.