diff --git a/classes/Users.php b/classes/Users.php index 8784131..3342454 100644 --- a/classes/Users.php +++ b/classes/Users.php @@ -1,10 +1,4 @@ time_now(); if ($this->databaseConnection()) { + $query = $this->db_connection->prepare("UPDATE `$this->customers_table` SET `auth_random` = :authRandom, `floPublicKey` = :floPublicKey, `updateDate` = '$now' WHERE `flo_id` = :floID LIMIT 1"); + $query->bindValue(':authRandom', $auth_random, PDO::PARAM_STR); + $query->bindValue(':floPublicKey', $floPublicKey, PDO::PARAM_STR); + $query->bindValue(':floID', $floID, PDO::PARAM_STR); + - $query = $this->db_connection->prepare(" - INSERT INTO $this->customers_table (`floPublicKey` ) - VALUES (:floPublicKey) - WHERE `flo_id` = :flo_id - "); - $query->bindParam('flo_id', $flo_id); - $query->bindParam('floPublicKey', $floPublicKey); - - if ($query->execute()) { - $row_count = $query->rowCount(); - if ($row_count == 1) { - return true; - } - return false; - } else { - return false; + if($query->execute()) { + return true; } } return false;