Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.0 » SQL Anywhere Server - Programming » SQL Anywhere Data Access APIs » SQL Anywhere PHP API » SQL Anywhere PHP API reference » Deprecated PHP functions

 

sqlanywhere_execute (deprecated)

Prototype
bool sqlanywhere_execute(  resource link_identifier, string sql_str )
Description

This function is deprecated.

Prepares and executes the SQL query sql_str on the connection identified by the link_identifier that has already been opened using sqlanywhere_connect or sqlanywhere_pconnect. This function returns TRUE or FALSE depending on the outcome of the query execution. This function is suitable for queries that do not return result sets. If you are expecting a result set, use the sqlanywhere_query function instead.

Parameters

link_identifier   A link identifier returned by sqlanywhere_connect or sqlanywhere_pconnect.

sql_str   A SQL query.

Returns

TRUE if the query executed successfully, otherwise, FALSE and an error message.

Example

This example shows how to execute a DDL statement using the sqlanywhere_execute function.

if( sqlanywhere_execute( $conn, "CREATE TABLE my_test_table( INT id )" ) ) {
   // handle success
} else {
   // handle failure
}
Related functions