Refactor software version queries to use 'rowID' instead of 'id' for consistency across the application

This commit is contained in:
“VeLiTi”
2025-12-11 15:45:14 +01:00
parent 9673d9be7b
commit c39a5ca648
4 changed files with 10 additions and 10 deletions

View File

@@ -42,7 +42,7 @@ switch ($action) {
}
// Get version details
$stmt = $pdo->prepare("SELECT * FROM software_versions WHERE id = ?");
$stmt = $pdo->prepare("SELECT * FROM software_versions WHERE rowID = ?");
$stmt->execute([$versionId]);
$version = $stmt->fetch(PDO::FETCH_ASSOC);
@@ -176,7 +176,7 @@ switch ($action) {
//QUERY AND VERIFY ALLOWED
if ($command == 'update' && isAllowed('software',$profile,$permission,'U') === 1){
$sql = 'UPDATE software_versions SET '.$clause.' WHERE id = ?';
$sql = 'UPDATE software_versions SET '.$clause.' WHERE rowID = ?';
$execute_input[] = $id;
$stmt = $pdo->prepare($sql);
$stmt->execute($execute_input);
@@ -187,7 +187,7 @@ switch ($action) {
$stmt->execute($execute_input);
}
elseif ($command == 'delete' && isAllowed('software',$profile,$permission,'D') === 1){
$stmt = $pdo->prepare('DELETE FROM software_versions WHERE id = ?');
$stmt = $pdo->prepare('DELETE FROM software_versions WHERE rowID = ?');
$stmt->execute([$id]);
//Add deletion to changelog