<?php
require_once('Database.php');
class RequestMsg extends Database{
  public $Id;
  public $Request;
  public $Sender;
  public $DateTimeMsg;
  public $Message;

  public function InsertRecord(){
    $Query = "INSERT INTO RequestMsg (Request, Sender, Message)
                            VALUES($this->Request,$this->Sender,'$this->Message')";
    return $this->ExecuteQueryReturnId($Query);
  }

    public function GetRecords(){
        $Query = "SELECT *  FROM RequestMsg WHERE Request = $this->Request ORDER BY DateTimeMsg DESC";
        return $this->ExecuteReader($Query);
    }

  public function GetRecord(){
    $Query = "SELECT *  FROM RequestMsg WHERE Id = $this->Id";
    return $this->ExecuteUniqueReader($Query);
  }
}
