Support server side prepared statements with PDO?

前端 未结 2 1781
孤街浪徒
孤街浪徒 2020-12-20 20:34

Given something like

DB()->prepare(\"SELECT * FROM mysql.general_log WHERE user_host LIKE ?\");

$statement->execute( array(\'%console%\') );

foreach(         


        
2条回答
  •  有刺的猬
    2020-12-20 20:49

    By default, PDO_MYSQL emulates the prepared statements. To use the native server-side prepared statements, one should explicitely set

    $PDO->setAttribute(PDO::ATTR_EMULATE_PREPARES,false);
    

提交回复
热议问题