Transfer to git
This commit is contained in:
16
includes/chat_reading_model.inc.php
Normal file
16
includes/chat_reading_model.inc.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
function retrieve_chat_history(object $pdo){
|
||||
$query = "SELECT username, content, date_sent FROM comments;";
|
||||
|
||||
$stmt = $pdo->prepare($query);
|
||||
$stmt->execute();
|
||||
$chat_history = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$stmt = null;
|
||||
$query = null;
|
||||
|
||||
return $chat_history;
|
||||
}
|
||||
Reference in New Issue
Block a user