From 957b5b583c861f259fa44422e1614ceb4e1f5f8b Mon Sep 17 00:00:00 2001 From: johnnyq Date: Mon, 3 Jul 2023 17:41:43 -0400 Subject: [PATCH] Sort primary location at the top always --- client_locations.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client_locations.php b/client_locations.php index da0046c5..42bfbd4e 100644 --- a/client_locations.php +++ b/client_locations.php @@ -15,7 +15,7 @@ $sql = mysqli_query( WHERE location_client_id = $client_id AND location_archived_at IS NULL AND (location_name LIKE '%$q%' OR location_address LIKE '%$q%' OR location_phone LIKE '%$phone_query%') - ORDER BY $sb $o LIMIT $record_from, $record_to" + ORDER BY location_primary DESC, $sb $o LIMIT $record_from, $record_to" ); $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));