General error: 1615 Prepared statement needs to be re-prepared
Since upgrading to Laravel 6, I am getting this error, specifically in my code where I do something like this:
$aging=DB::table('view_aging_report')->select('view_aging_report.*')->where('CustID', $CustID)->first();
I have created several views that I created in mysql. In my laravel controllers when I select from the views, see above, they produce the 1615 prepared statement error. I can fix it by adding to my database.php file mysql options as follows:
'options' => [ \PDO::ATTR_EMULATE_PREPARES => true ]
I could not change any Mysql variables as I am on a shared server and the hosting company will not do it, ie.. 'table_open_cache'
I have read searching for solutions to this problem that there might be a security issue created, by setting PDO::ATTR_EMULATE_PREPARES => true.
Just wondering if this is the best solution, or if there is another solution ?
Please or to participate in this conversation.