-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMessaging
More file actions
31 lines (28 loc) · 728 Bytes
/
Copy pathMessaging
File metadata and controls
31 lines (28 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
class Message {
private $pdo = null;
private $stmt = null;
public $error;
function __construct() {
$this->pdo = new PDO(
"mysql:host=" . DB_HOST . ";dbname=" . DB_NAME . ";charset=" . DB_CHARSET,
DB_USER,
DB_PASSWORD,
[
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC
]
);
}
function __destruct() {
if ($this->stmt !== null) {
$this->stmt = null;
}
if ($this->pdo !== null) {
$this->pdo = null;
}
}
// Add methods for sending, retrieving, and managing messages
// ...
}
?>