Hi there,
being a novice I am having problems showing files on my webpage in proper date order. They are stored in a mysql database.
I have stored the files in a table called filestore which has 5 columns:
ID = int column
StoryDate = Varchar column
fileName = Varchar column
mimetype = Varchar column
description = Varchar column
filedata = mediumblob column
The dates look like this: 8-November-2011, 21-March-2012 etc.
and when drawn from the database they are formatted by an external file 'date.php' to look like this: 08-11-2011, 21-03-2012 etc. I tried to order by date DESC.
Below is a snippet of the code:
// Default page view: lists stored files
$sql = 'SELECT id, filename, mimetype, storydate FROM filestore ORDER BY filestore.storyDate DESC, filestore.ID LIMIT 60';
$filelist = @mysql_query($sql);
if (!$filelist) {
exit('Database error: ' . mysql_error());
}
?>
I wonder could the problem be that 'StoryDate' Varchar column is the wrong type? should it be Date or something else?
The webpage in question is here: http://www.sercweb.com
Any help greatly appreciated!
Roytheboy.