28 lines
381 B
PHP
28 lines
381 B
PHP
<?php
|
|
|
|
class
|
|
Chat
|
|
{
|
|
var $id;
|
|
var $user_id;
|
|
var $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");
|
|
}
|
|
}
|
|
|