Jump to content

Help with sorting results by month


1219

Recommended Posts

I want to try to sort these results from this page http://www.botkinfuneralservice.com/obituaries/index.php by month in order of calendar year (Jan, Feb,... Dec). How would I do this?

 

 

$maxRows_DetailRS1 = 25;

$pageNum_DetailRS1 = 0;

if (isset($_GET['pageNum_DetailRS1'])) {

  $pageNum_DetailRS1 = $_GET['pageNum_DetailRS1'];

}

$startRow_DetailRS1 = $pageNum_DetailRS1 * $maxRows_DetailRS1;

 

$colname_DetailRS1 = "-1";

if (isset($_GET['id'])) {

  $colname_DetailRS1 = $_GET['id'];

}

mysql_select_db($database_BotkinFuneralHome, $BotkinFuneralHome);

$query_DetailRS1 = sprintf("SELECT * FROM onlineObituaries WHERE id = %s ORDER BY last_name ASC", GetSQLValueString($colname_DetailRS1, "int"));

$query_limit_DetailRS1 = sprintf("%s LIMIT %d, %d", $query_DetailRS1, $startRow_DetailRS1, $maxRows_DetailRS1);

$DetailRS1 = mysql_query($query_limit_DetailRS1, $BotkinFuneralHome) or die(mysql_error());

$row_DetailRS1 = mysql_fetch_assoc($DetailRS1);

 

if (isset($_GET['totalRows_DetailRS1'])) {

  $totalRows_DetailRS1 = $_GET['totalRows_DetailRS1'];

} else {

  $all_DetailRS1 = mysql_query($query_DetailRS1);

  $totalRows_DetailRS1 = mysql_num_rows($all_DetailRS1);

}

$totalPages_DetailRS1 = ceil($totalRows_DetailRS1/$maxRows_DetailRS1)-1;

?>

Link to comment
https://forums.phpfreaks.com/topic/86560-help-with-sorting-results-by-month/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.