implemented functionality to write to Database after game ends
This commit is contained in:
parent
03e5591e0a
commit
dc99bdcab5
2 changed files with 11 additions and 7 deletions
|
|
@ -3,6 +3,10 @@
|
|||
$password = 'password';
|
||||
$config = require('config.php');
|
||||
$db = new Database($config['database'], $username, $password);
|
||||
$data = json_decode(file_get_contents("php://input"), true);
|
||||
dd($data);
|
||||
$db->update($data);
|
||||
$data = json_decode(file_get_contents("php://input"), true);
|
||||
$db->query("UPDATE user SET level= :level, xp= :xp, coins= :coins WHERE username = :user", [
|
||||
"level" => $data["level"],
|
||||
"xp" => $data["xp"],
|
||||
"coins" => $data["coins"],
|
||||
"user" => $data["username"]
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue