Skip to content

Commit

Permalink
Fix sql error when updating a starr app
Browse files Browse the repository at this point in the history
  • Loading branch information
austinwbest committed Dec 28, 2024
1 parent e239af5 commit 3a4af15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions root/app/www/public/classes/traits/Database/Starrs.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function addStarrApp($starrApp, $fields = [])
$this->query($q);

if ($this->error() != 'not an error') {
return $this->error();
return 'addStarrApp() :: ' . $this->error();
}

$this->cache->bust(STARRS_TABLE_CACHE_KEY);
Expand All @@ -82,12 +82,12 @@ public function addStarrApp($starrApp, $fields = [])
public function updateStarrApp($id, $fields = [])
{
$q = "UPDATE " . STARRS_TABLE . "
SET name = '" . $this->prepare($fields['name']) . "', url = '" . $this->prepare($fields['url']) . "'', apikey = '" . $this->prepare($fields['apikey']) . "', username = '" . $this->prepare($fields['username']) . "', password = '" . $this->prepare($fields['password']) . "'
SET name = '" . $this->prepare($fields['name']) . "', url = '" . $this->prepare($fields['url']) . "', apikey = '" . $this->prepare($fields['apikey']) . "', username = '" . $this->prepare($fields['username']) . "', password = '" . $this->prepare($fields['password']) . "'
WHERE id = " . intval($id);
$this->query($q);

if ($this->error() != 'not an error') {
return $this->error();
return 'updateStarrApp() :: ' . $this->error();
}

$this->cache->bust(STARRS_TABLE_CACHE_KEY);
Expand Down

0 comments on commit 3a4af15

Please sign in to comment.