replace all instances of mysqli_fetch_array with mysqli_fetch_assoc for better performance and memory usage

This commit is contained in:
johnnyq
2026-01-14 17:30:23 -05:00
parent cb8b99d6ae
commit 0a30300bde
361 changed files with 1880 additions and 1904 deletions

View File

@@ -17,15 +17,15 @@ if (!isset($_GET['ticket_id'], $_GET['url_key'])) {
}
// Company info
$company_sql_row = mysqli_fetch_array(mysqli_query($mysqli, "
SELECT
$company_sql_row = mysqli_fetch_assoc(mysqli_query($mysqli, "
SELECT
company_phone,
company_phone_country_code,
company_website
FROM
company_website
FROM
companies,
settings
WHERE
WHERE
companies.company_id = settings.company_id
AND companies.company_id = 1"
));
@@ -52,7 +52,7 @@ if (mysqli_num_rows($ticket_sql) !== 1) {
exit();
}
$ticket_row = mysqli_fetch_array($ticket_sql);
$ticket_row = mysqli_fetch_assoc($ticket_sql);
if ($ticket_row) {
@@ -149,7 +149,7 @@ if ($ticket_row) {
<?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");
while ($row = mysqli_fetch_array($sql)) {
while ($row = mysqli_fetch_assoc($sql)) {
$ticket_reply_id = intval($row['ticket_reply_id']);
$ticket_reply = $purifier->purify($row['ticket_reply']);
$ticket_reply_created_at = nullable_htmlentities($row['ticket_reply_created_at']);