We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef9996d commit 1547f32Copy full SHA for 1547f32
resources/lib/UnitySQL.php
@@ -198,12 +198,14 @@ public function getAllAccountDeletionRequests(): array
198
199
public function updateUserLastLogin(string $uid): void
200
{
201
- $stmt = $this->conn->prepare(
202
- sprintf(
203
- "UPDATE %s SET last_login=CURRENT_TIMESTAMP WHERE operator=:uid",
204
- self::TABLE_USER_LAST_LOGINS,
205
- ),
206
- );
+ $table = self::TABLE_USER_LAST_LOGINS;
+ $stmt = $this->conn->prepare("
+ INSERT INTO $table
+ (operator, last_login)
+ VALUES(:uid, CURRENT_TIMESTAMP)
+ ON DUPLICATE KEY UPDATE
207
+ last_login=CURRENT_TIMESTAMP
208
+ ");
209
$stmt->bindParam(":uid", $uid);
210
$stmt->execute();
211
}
0 commit comments