mirror of
https://github.com/itflow-org/itflow
synced 2026-08-10 09:37:15 +00:00
Query Optimization: Select only needed columns instead of SELECT * on looped queries
This commit is contained in:
@@ -269,7 +269,9 @@ if (isset($_GET['id']) && intval($_GET['id'])) {
|
||||
<br>
|
||||
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM ticket_replies LEFT JOIN users ON ticket_reply_by = user_id LEFT JOIN contacts ON ticket_reply_by = contact_id WHERE ticket_reply_ticket_id = $ticket_id AND ticket_reply_archived_at IS NULL AND ticket_reply_type != 'Internal' ORDER BY ticket_reply_id DESC");
|
||||
$sql = mysqli_query($mysqli, "SELECT contact_name, contact_photo, ticket_reply, ticket_reply_by, ticket_reply_created_at,
|
||||
ticket_reply_id, ticket_reply_type, ticket_reply_updated_at, user_avatar, user_id,
|
||||
user_name FROM ticket_replies LEFT JOIN users ON ticket_reply_by = user_id LEFT JOIN contacts ON ticket_reply_by = contact_id WHERE ticket_reply_ticket_id = $ticket_id AND ticket_reply_archived_at IS NULL AND ticket_reply_type != 'Internal' ORDER BY ticket_reply_id DESC");
|
||||
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$ticket_reply_id = intval($row['ticket_reply_id']);
|
||||
|
||||
Reference in New Issue
Block a user