public function updateSthsGoalie($id, $field, $val) { try { $dbh = \SparkLib\DB::pdo(); $sth = $dbh->prepare("UPDATE sths_goalie SET {$field} = :val WHERE number = :id"); $sth->execute([':id' => $id, ':val' => $val]); } catch (PDOException $e) { echo $e->getMessage(); } }
public function updateTransaction($id, $timestamp, $newVal) { try { $dbh = \SparkLib\DB::pdo(); $sth = $dbh->prepare("UPDATE transactions SET value = :newVal WHERE datetime = :time AND id = :id"); $sth->execute([':newVal' => $newVal, ':time' => $timestamp, ':id' => $id]); } catch (PDOException $e) { echo $e->getMessage(); } }