Пример #1
0
 function __construct($where, $order = "")
 {
     $this->titles = array();
     $this->posters = array();
     $this->comments = array();
     $this->ids = array();
     $this->host = 'localhost';
     $this->user = '******';
     $this->password = '';
     $this->database = 'forumDB';
     $order = "id {$order}";
     $db = new DbAccess($this->host, $this->user, $this->password, $this->database);
     $result = $db->selectDB("threads", $where, '', $order);
     if ($result) {
         $rows = $result->num_rows;
         for ($i = 0; $i < $rows; $i++) {
             $result->data_seek($i);
             $row = $result->fetch_array(MYSQLI_ASSOC);
             array_push($this->titles, $row['title']);
             array_push($this->posters, $row['poster']);
             array_push($this->comments, $row['comment']);
             array_push($this->ids, $row['id']);
         }
     }
 }