How to Solve SQL state [HY000]: general error 2503

SQLSTATE[HY000]: General error 2503

This error is caused by $this – & gt; query. In version 3.2.3, the query and execute methods should be called separately, otherwise an error will be reported in debug mode

After 3.2.3, the TP framework requires different method calls for read and write operations. If it is used incorrectly, an error will be reported in non debugging mode.

Read data using $this->query
Write data using $this->execute

After TP5, it is written as follows:

Read data using Db::query
Write data using Db::execute


Read More: