Change the way null last is done for Postgres.

This commit is contained in:
markjcrane 2015-10-20 02:05:03 -06:00
parent 588e4ebabc
commit 4c3fa1f9e7
1 changed files with 4 additions and 1 deletions

View File

@ -178,7 +178,10 @@ else {
$sql .= "order by ".$order_by." ".$order." ";
}
else {
$sql .= "order by case when last_mod_date is null then 1 else 0, last_mod_date desc ";
$sql .= "order by last_mod_date desc ";
if ($db_type == "pgsql") {
$sql .= "nulls last ";
}
}
$sql .= "limit ".$rows_per_page." offset ".$offset." ";
$prep_statement = $db->prepare(check_sql($sql));