Skip to content

Commit

Permalink
Merge pull request #6 from AchukwiPeace/patch-6
Browse files Browse the repository at this point in the history
Create Messaging
  • Loading branch information
Favourez authored Jun 15, 2024
2 parents 8b9408f + 63310a0 commit 2481bac
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Messaging
Original file line number Diff line number Diff line change
@@ -0,0 +1,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
// ...
}
?>

0 comments on commit 2481bac

Please sign in to comment.