Session::sql

Create SQL query

Description

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.

Parameters

query

SQL statement to execute.

Return Values

An SqlStatement object.

Examples

Example #1 mysql_xdevapi\Session::sql example

<?php
$session = mysql_xdevapi\getSession("mysqlx://user:password@localhost");

$session->sql("CREATE DATABASE addressbook")->execute();
?>