MySQL
+----+------------+ | id | timestamp | +----+------------+ | 1 | 1306922400 | +----+------------+ | 2 | 1306926000 | +----+------------+ | 3 | 1306929600 | +----+------------+
PHP
$a = mysql_query("SELECT * FROM `table` ORDER BY ?? DESC, `timestamp` DESC");
Order by:
Start where
id
is equal to2
Then order by
timestamp
Order should be: 2, 3, 1