|
- <?php
-
- class
- Chat
- {
- public int $id;
- public int $user_id;
- public string $pass;
-
- function
- insert ():
- int
- {
- $sql = "
- INSERT INTO
- chats (
- user_id,
- text)
- VALUES
- (
- {$this -> user_id},
- '{$this -> text}')";
- $GLOBALS['__db_connection'] -> query ($sql)
- or die ("db_insert error $sql");
- }
- }
|