mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 10:54:52 +00:00
replace all instances of mysqli_fetch_array with mysqli_fetch_assoc for better performance and memory usage
This commit is contained in:
@@ -36,7 +36,7 @@ if (isset($_POST['rename_folder'])) {
|
||||
|
||||
// Get old Folder Name Client ID for Logging
|
||||
$sql = mysqli_query($mysqli,"SELECT folder_name, folder_client_id FROM folders WHERE folder_id = $folder_id");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$old_folder_name = sanitizeInput($row['folder_name']);
|
||||
$client_id = intval($row['folder_client_id']);
|
||||
|
||||
@@ -59,7 +59,7 @@ if (isset($_GET['delete_folder'])) {
|
||||
|
||||
// Get Folder Name Client ID for Logging
|
||||
$sql = mysqli_query($mysqli,"SELECT folder_name, folder_client_id FROM folders WHERE folder_id = $folder_id");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$folder_name = sanitizeInput($row['folder_name']);
|
||||
$client_id = intval($row['folder_client_id']);
|
||||
|
||||
@@ -67,7 +67,7 @@ if (isset($_GET['delete_folder'])) {
|
||||
|
||||
// Move files in deleted folder back to the root folder /
|
||||
$sql_documents = mysqli_query($mysqli,"SELECT * FROM documents WHERE document_folder_id = $folder_id");
|
||||
while($row = mysqli_fetch_array($sql_documents)) {
|
||||
while($row = mysqli_fetch_assoc($sql_documents)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
|
||||
mysqli_query($mysqli,"UPDATE documents SET document_folder_id = 0 WHERE document_id = $document_id");
|
||||
|
||||
Reference in New Issue
Block a user