kalster Posted April 10, 2014 Share Posted April 10, 2014 this code does not sort by timestamp and i need to know why this is not working. $sql = "SELECT * FROM test WHERE y='$y' AND z='$z' ORDER BY timestamp DESC"; this code does sort by timestamp. $sql = "SELECT * FROM test WHERE y='$y' ORDER BY timestamp DESC"; `timestamp` INT(12) NOT NULL, i am using the near resent version of mysql. Quote Link to comment https://forums.phpfreaks.com/topic/287683-timestamp-not-sorting/ Share on other sites More sharing options...
requinix Posted April 10, 2014 Share Posted April 10, 2014 It is sorting. Why do you think it isn't? Quote Link to comment https://forums.phpfreaks.com/topic/287683-timestamp-not-sorting/#findComment-1475729 Share on other sites More sharing options...
Solution kalster Posted April 11, 2014 Author Solution Share Posted April 11, 2014 (edited) when z=0 then timestamp was not sorting. maybe because i had more than one field with z=0. i solved this topic by given z a greater value. at my first post, resent should be called recent Edited April 11, 2014 by kalster Quote Link to comment https://forums.phpfreaks.com/topic/287683-timestamp-not-sorting/#findComment-1475743 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.