Documentation Home
MySQL PHP API
Download this Manual
PDF (US Ltr) - 2.4Mb
PDF (A4) - 2.4Mb
HTML Download (TGZ) - 250.9Kb
HTML Download (Zip) - 258.4Kb


MySQL PHP API  /  ...  /  Session::executeSql

5.28.6 Session::executeSql

Copyright 1997-2019 the PHP Documentation Group.

  • Session::executeSql

    Execute an SQL statement

Description

public Object mysql_xdevapi\Session::executeSql(string statement);

Execute an SQL statement, similar to executing the sql() and execute() methods.

Parameters

statement

SQL statement to execute

Return Values

An SqlStatementResult object on success, or throws an Exception if the SQL statement fails.

Examples

Example 5.116 mysql_xdevapi\Session::executeSql example

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

$session->executeSql("CREATE DATABASE addressbook");