mirror of
https://github.com/itflow-org/itflow
synced 2026-08-18 13:35:12 +00:00
Query Optimization: Select only needed columns instead of SELECT * on looped queries
This commit is contained in:
@@ -29,7 +29,7 @@ ob_start();
|
||||
<select class="form-control" name="vendor_template_id" required>
|
||||
<option value="">- Select Template -</option>
|
||||
<?php
|
||||
$sql_vendor_templates = mysqli_query($mysqli, "SELECT * FROM vendor_templates WHERE vendor_template_archived_at IS NULL ORDER BY vendor_template_name ASC");
|
||||
$sql_vendor_templates = mysqli_query($mysqli, "SELECT vendor_template_id, vendor_template_name FROM vendor_templates WHERE vendor_template_archived_at IS NULL ORDER BY vendor_template_name ASC");
|
||||
while ($row = mysqli_fetch_assoc($sql_vendor_templates)) {
|
||||
$vendor_template_id = intval($row['vendor_template_id']);
|
||||
$vendor_template_name = escapeHtml($row['vendor_template_name']);
|
||||
|
||||
2
agent/modals/vendor/vendor_edit.php
vendored
2
agent/modals/vendor/vendor_edit.php
vendored
@@ -112,7 +112,7 @@ ob_start();
|
||||
<option value="0">- None -</option>
|
||||
<?php
|
||||
|
||||
$sql_vendor_templates = mysqli_query($mysqli, "SELECT * FROM vendor_templates WHERE vendor_template_archived_at IS NULL ORDER BY vendor_template_name ASC");
|
||||
$sql_vendor_templates = mysqli_query($mysqli, "SELECT vendor_template_id, vendor_template_name FROM vendor_templates WHERE vendor_template_archived_at IS NULL ORDER BY vendor_template_name ASC");
|
||||
while ($row = mysqli_fetch_assoc($sql_vendor_templates)) {
|
||||
$vendor_template_id_select = $row['vendor_template_id'];
|
||||
$vendor_template_name_select = escapeHtml($row['vendor_template_name']); ?>
|
||||
|
||||
Reference in New Issue
Block a user