db = new mysqli ($db_host, $db_user, $db_pass, 'goatoh_training', $db_port); } function send_chat ( int $user_id, string $text): void { $sql = " INSERT INTO chats ( user_id, text) VALUES ( $user_id, '$text')"; $this -> db -> query ($sql) or die ("db_insert error $sql"); } }