|
sqlanywhere_execute
Prototype
bool sqlanywhere_connect( resource link_identifier,
string sql_str )
Description
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.
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
sqlanywhere_query
|