$wpdb and MySQL Create Trigger

In the question you linked to, the solution was to use mysqli_multi_query as the API for executing the SQL. $wpdb desen’t have an API to do a multi query therefor you can’t use it directly, but you can get the handle to the mysql interface from $wpdb->dbh and do something like

$sql_trigger = "....";
mysqli_multi_query($wpdb->dbh,$sql_trigger);

Leave a Comment