Hi,
I am trying to sort the table where I store a date in separate cells (year, month, day). When listing the ouput I want the date to be sorted either in ASC or DESC order. However, only last column in the $column variable is sorted, no matter how many columns are included in the variable. In this case I end up with sorted days but the months are not sorted. This makes me think that I cannot sort on more than one criteria (column). Am I correct? Is there a way to sort the tables in Dreamweaver on more than one criteria? Please help. Below is the code with portions eliminated for clarity.
<?php
$sort = ($_GET['sort']);
$column = ($_GET['column']);
if (!$sort)
{
$sort = "ASC";
}
if (!$column)
{
$column = "eventinfo.eventyear,eventinfo.eventmonth,eventinfo.eventday";
}
mysql_select_db($database, $connection);
$query_rsEventData = "SELECT eventinfo.eventmonth, eventinfo.eventday, eventinfo.eventyear FROM eventinfo WHERE ... ORDER BY $column $sort";
if ($sort == "ASC")
{
$sort = "DESC";
}
else
{
$sort = "ASC";
}
?>
<a href = "file.php?sort=<?php echo "$sort";?>&column=eventinfo.eventyear,eventinfo.eventmonth,eventinfo.eventday">