You can do something like that:
$res = $this->db->execute("UPDATE media SET image_1 = ?, image_2 = ? WHERE usersId = ?",array($uploadDir1,$uploadDir2,$id));
if (!$res) {
$this->flash->error("Something went wrong...");
} else {
$this->flash->success("Image was updated successfully");
}