diff --git a/public/userarea/export_to_lims.php b/public/userarea/export_to_lims.php index b3522d7..1b5f833 100644 --- a/public/userarea/export_to_lims.php +++ b/public/userarea/export_to_lims.php @@ -107,9 +107,10 @@ try { // 🔹 STEP 3: Fetch Parts (including idmatrice and part id for custom fields) $stmt = $pdo->prepare(" - SELECT id AS part_id, part_number, part_description, material, color, mix, idmatrice, dateexpiry - FROM identification_parts - WHERE iddatadb = :iddatadb + SELECT id AS part_id, part_number, part_description, material, color, mix, idmatrice, dateexpiry + FROM identification_parts + WHERE iddatadb = :iddatadb + ORDER BY CAST(part_number AS UNSIGNED) ASC, part_number ASC "); $stmt->execute(['iddatadb' => $iddatadb]); $parts = $stmt->fetchAll(PDO::FETCH_ASSOC);