Query Optimization: Select only needed columns instead of SELECT * on looped queries

This commit is contained in:
johnnyq
2026-08-06 12:59:43 -04:00
parent 77defcf7d8
commit b8c9d5b4cf
117 changed files with 345 additions and 227 deletions

View File

@@ -111,7 +111,7 @@ ob_start();
<select class="form-control select2" name="network">
<option value="">- Select Network -</option>
<?php
$sql_network_select = mysqli_query($mysqli, "SELECT * FROM networks WHERE network_archived_at IS NULL AND network_client_id = $client_id ORDER BY network_name ASC");
$sql_network_select = mysqli_query($mysqli, "SELECT network, network_id, network_name FROM networks WHERE network_archived_at IS NULL AND network_client_id = $client_id ORDER BY network_name ASC");
while ($row = mysqli_fetch_assoc($sql_network_select)) {
$network_id = $row['network_id'];
$network_name = escapeHtml($row['network_name']);