Reputation: 47
I have a view in a MariaDB and a simple PDO query to select all data.
Working with regular tables, there are no issues at all. The only issue I have is that as soon as I use a VIEW, I get the error that the view does not exist.
[826]::sqlstate[42s02]: base table or view not found: 1146 table 'kafexxxx_diner.reservationsxmonth' doesn't exist
::select reservationsxmonth.property,reservationsxmonth.period,reservationsxmonth.total from reservationsxmonth limit 0, 10000
It doesn't look like a rights issue as the statement performs fine in phpMyAdmin.
The question is, can I use PDO to access views, and how to do it? Does the PDO connection require certain options?
$pdo='mysql:host=127.0.0.1;dbname=kafexxxx_diner;port=3306;charset=utf8';
$this->connection = new PDO($pdo, $this->userid, $this->password, $options);
$this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
Upvotes: 1
Views: 983