Move more select * to column select for further optimization

This commit is contained in:
johnnyq
2026-08-06 13:44:02 -04:00
parent b3744e9ed5
commit 108781db5b
37 changed files with 107 additions and 52 deletions

View File

@@ -211,7 +211,7 @@ if (isset($_POST['add_rack_unit'])) {
}
// Check if the unit range is already occupied
$check_sql = mysqli_query($mysqli, "SELECT * FROM rack_units WHERE unit_rack_id = $rack_id AND unit_start_number <= $unit_end AND unit_end_number >= $unit_start");
$check_sql = mysqli_query($mysqli, "SELECT 1 FROM rack_units WHERE unit_rack_id = $rack_id AND unit_start_number <= $unit_end AND unit_end_number >= $unit_start");
if (mysqli_num_rows($check_sql) > 0) {
// If there is an overlap, return an error message;