From 8937dd9de15e01f00be575d43131027ae5f2efe4 Mon Sep 17 00:00:00 2001 From: Miteruzo Date: Mon, 17 Jul 2023 06:47:28 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- create_user.php | 6 +++--- modules/chat.mod.php | 6 +++--- modules/user.mod.php | 12 +++++++----- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/create_user.php b/create_user.php index 315fd9d..fe7cc1e 100644 --- a/create_user.php +++ b/create_user.php @@ -16,7 +16,7 @@ $user -> inheritance_code = implode (array_map (fn () => rand (0, 9), range (1, $user -> insert (); -echo [$user -> id, - $user -> pass, - $user -> inheritance_code]; +echo implode (',', [$user -> id, + $user -> pass, + $user -> inheritance_code]); diff --git a/modules/chat.mod.php b/modules/chat.mod.php index e73b46f..f6bab22 100644 --- a/modules/chat.mod.php +++ b/modules/chat.mod.php @@ -3,9 +3,9 @@ class Chat { - var $id; - var $user_id; - var $pass; + public int $id; + public int $user_id; + public string $pass; function insert (): diff --git a/modules/user.mod.php b/modules/user.mod.php index 8fd1789..88bb29e 100644 --- a/modules/user.mod.php +++ b/modules/user.mod.php @@ -3,10 +3,10 @@ class User { - var $id; - var $name; - var $pass; - var $inheritance_code; + public int $id; + public string $name; + public string $pass; + public string $inheritance_code; public static function find ( @@ -44,11 +44,13 @@ User name, pass, inheritance_code, - created_at) + created_at, + modified_at) VALUES ('{$this -> name}', '{$this -> pass}', '{$this -> inheritance_code}', + NOW(), NOW())"; $GLOBALS['__db_connection'] -> query ($sql) or die ("db_insert error $sql");