I'm not able to make header location
redirect to a table field.
In this field, you have the link of a PDF document.
See the code:
case 'mostra-id':
$link = Connection::select("SELECT link FROM 'arquivos' where id =" . App::$key);
$sql = "update 'arquivos' set 'acessos'= acessos + 1 where id=" . App::$key;
$dados = Connection::exec($sql);
header('Location: ' . $link['link']);
break;
The link in the table is written this way: sistema/public/arquivos/pdf/01.pdf
The update is usually correct, but does not open the link when redirecting. Giving the following error:
Fatal error: Can not use object of type PDOStatement as array in