瀏覽代碼

Change the way null last is done for Postgres.

markjcrane 10 年之前
父節點
當前提交
21c5c0ef79
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      contacts.php

+ 4 - 1
contacts.php

@@ -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));