MySQL and PHP
Copyright 1997-2021 the PHP Documentation Group.
Session::sql
Execute SQL query
public mysql_xdevapi\SqlStatement mysql_xdevapi\Session::sql(string query);
Create a native SQL statement. Placeholders are supported using
the native "?" syntax. Use the
execute
method to execute the SQL statement.
query
SQL statement to execute.
An SqlStatement object.
Example 5.127 mysql_xdevapi\Session::sql
example
<?php $session = mysql_xdevapi\getSession("mysqlx://user:password@localhost"); $session->sql("CREATE DATABASE addressbook")->execute(); ?>