Executing Multiple Queries Using PDO

后端 未结 3 1579
既然无缘
既然无缘 2021-01-28 04:13

I am trying to execute the following query using a PDO Prepared Statement, but when I call $query->fetch(); it throws an exception SQLSTATE[HY000]: General

3条回答
  •  自闭症患者
    2021-01-28 04:56

    You would be correct in that PDO (and I believe any PHP method?) does not allow for multiple queries in a single by default. There are some workarounds which you can read about more, such as:

    PDO support for multiple queries (PDO_MYSQL, PDO_MYSQLND)

    but they do increase the risk of SQL injection so it is ill-advised.

提交回复
热议问题