0
Good afternoon guys, I have a problem with my DB, but I can’t solve, the error is this:
Parse error: syntax error, Unexpected '[' in /home/Storage/2/3e/Eb/noticiasdasgerais/public_html/yteste/Lib/DB.php on line 44
The line in code 44 is:
public function fetchAll($sql) {
if ($this->pagination == true) {
$res = $this->con->query($sql) or die($this->con->errorInfo()[2]); //tratamento de exceções Linha 44
$this->rows = count($res->fetchAll(PDO::FETCH_OBJ));
$this->paginateLink();
$sql .= " LIMIT $this->page, $this->perpage";
$this->pagination = false;
}
$res = $this->con->query($sql) or die($this->con->errorInfo()[2]); //tratamento de exceções
if ($res) {
$this->data = $res->fetchAll(PDO::FETCH_OBJ);
return $this->data;
}
}
Alias the php version of my hosting is 5.2