tommyda Posted November 15, 2009 Share Posted November 15, 2009 I have a list of movie titles in a database each with a time stamp of the release date The query: <?php $getvideos = mysql_query("SELECT * FROM videolistings ORDER BY releasedate DESC")or die(mysql_error());?> But for some reason the videos are not listing in descending order, EG: the videos on this page http://bit.ly/L8h7F are displaying 2 results from 2000 first then more recent ones from 08 and 09 after. Here is the while loop: <?php while ($video = mysql_fetch_array($getvideos)) { echo '<div style="width:280px; float:left; border:1px dotted #666; padding:5px; margin:5px; "><a href="'.$baseurl.'/videos/'.$video['slug'].'" title="'.ucwords($video['name']).'"><img width="80px"; height="110px"; src="'.$video['smlimg'].'" border="0"/></a></div>'; };?> Can anyone please help me EDIT: I have echo'd out the timestamps for each listing. Quote Link to comment Share on other sites More sharing options...
tommyda Posted November 15, 2009 Author Share Posted November 15, 2009 Worked it out, Ill explain what i did for any one else having the same problem. Originally the field was a varchar but for ORDER BY to work it needs to be set as INT. Quote Link to comment 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.