Update Users.php
This commit is contained in:
parent
67009848c3
commit
dfa6b6541d
@ -1,10 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* Created by PhpStorm.
|
|
||||||
* User: user
|
|
||||||
* Date: 17-Oct-16
|
|
||||||
* Time: 9:22 AM
|
|
||||||
*/
|
|
||||||
|
|
||||||
class Users {
|
class Users {
|
||||||
|
|
||||||
@ -273,26 +267,18 @@ class Users {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function insert_floPublicKey($flo_id, $floPublicKey) {
|
public function insert_flo_details($floID, $auth_random, $floPublicKey) {
|
||||||
|
|
||||||
|
$now = $this->time_now();
|
||||||
if ($this->databaseConnection()) {
|
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("
|
if($query->execute()) {
|
||||||
INSERT INTO $this->customers_table (`floPublicKey` )
|
return true;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user