Hi everyone, I have a database view, and it will display on the page list, but the error message appears SQLSTATE[HY000]: General error: 1615 Prepared statement needs to be re-prepared.
How to solve it?
Take a look at this solution given here if it helps. php - Laravel: General error: 1615 Prepared statement needs to be re-prepared - Stack Overflow
I don’t know which method to use in the forum you shared. Is it by adding “\PDO::ATTR_EMULATE_PREPARES => true” (any repercussions to be accepted?) or by “SET GLOBAL table_definition_cache = 1024” or even by “protected $primaryKey = ‘id’;”(how can it be from database views). Please tell me?
The issue with how the database view query has been written, the best option would be to rewrite the query. .“\PDO::ATTR_EMULATE_PREPARES => true” is more like a bypass. What the above does is escape query parameter values on the PDO library with strings instead of on the MySQL server using the binary protocol.
I will try to implement it, thanks