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

SQL Anywhere 10.0.1 » SQL Anywhere Server - Programming » SQL Anywhere PHP API » SQL Anywhere PHP API reference

sqlanywhere_pconnect Next Page

sqlanywhere_query


Prototype

resource sqlanywhere_query( resource link_identifier, string sql_str )

Description

Prepares and executes the SQL query sql_str on the connection identified by link_identifier that has already been opened using sqlanywhere_connect or sqlanywhere_pconnect. For queries that do not return result sets, you can use the sqlanywhere_execute function.

Parameters

link_identifier    The link identifier returned by a sqlanywhere_connect function.

sql_str    A SQL statement supported by SQL Anywhere.

For more information about SQL statements, see SQL Statements.

Returns

A positive value representing the result ID on success, or 0 and an error message on failure.

Example

This example executes the query SELECT * FROM SYSTAB on the SQL Anywhere database.

$result = sqlanywhere_query( $conn, "SELECT * FROM SYSTAB" );
Related functions