Bind id as int in database

This commit is contained in:
Thomas Rubini 2023-01-27 12:01:29 +01:00
parent 7819d8ff83
commit af5ef9aba1
No known key found for this signature in database
GPG Key ID: C7D287C8C1CAC373

View File

@ -57,7 +57,7 @@ final class UserModel extends UserSessionModel
public function update(){
$O_model = Model::get();
$stmt = $O_model->prepare("UPDATE USER SET EMAIL=:email, USERNAME=:username, PASS_HASH=:password_hash, FIRST_SEEN=:first_seen, LAST_SEEN=:last_seen, ADMIN=:admin, DISABLED=:disabled WHERE ID=:id");
$stmt->bindParam("id", $this->I_ID);
$stmt->bindParam("id", $this->I_ID, PDO::PARAM_INT);
$stmt->bindParam("email", $this->S_EMAIL);
$stmt->bindParam("username", $this->S_USERNAME);
$stmt->bindParam("password_hash", $this->S_PASSWORD_HASH);
@ -98,7 +98,7 @@ final class UserModel extends UserSessionModel
public static function getByID($I_id){
$O_model = Model::get();
$stmt = $O_model->prepare("SELECT * FROM USER WHERE ID=:id");
$stmt->bindParam("id", $I_id);
$stmt->bindParam("id", $I_id, PDO::PARAM_INT);
$stmt->execute();
$row = $stmt->fetch();