I’m using Silex as well as Doctrine. It’s worked great for me for everything until I needed to bindValue for a LIMIT value. PDO’s default behavior is to insert quotes around the number, which is obviously not workable. So, the solution is to set the data_type parameter. Unfortunately, it throws an error.
My Code
$start_num = 3;
$stmt = $app['db']->prepare('SELECT * FROM myTable LIMIT ?,10');
$stmt->bindValue(1, $start_num, PDO::PARAM_INT);
The Error
Fatal error: Class 'Silex\Provider\PDO' not found in ...
Most answers I’ve found regarding this issue say that it’s a telltale sign of PDO not being compiled/enabled, however I’ve been using Doctrine (which relies on PDO?) successfully for a while with no problem.
Is this an issue with Doctrine? Is there something I’m doing wrong with my code?
This is a namespacing issue, if this code is in a class under the
Silex\ProvidernamespaceTry