PECL CUBRID >= 8.3.1
cubrid_query - Send a CUBRID query
Code Examples

cubrid_query( string$query, [resource$conn_identifier] ): resource

cubrid_query sends a unique query (multiple queries are not supported) to the currently active database on the server that's associated with the specified conn_identifier.



An SQL query

Data inside the query should be properly escaped.


The CUBRID connection. If the connection identifier is not specified, the last connection opened by cubrid_connect is assumed.

Return Values

For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset, cubrid_query returns a resource on success, or false on error.

For other type of SQL statements, INSERT, UPDATE, DELETE, DROP, etc, cubrid_query returns true on success or false on error.

The returned result resource should be passed to cubrid_fetch_array, and other functions for dealing with result tables, to access the returned data.

Use cubrid_num_rows to find out how many rows were returned for a SELECT statement or cubrid_affected_rows to find out how many rows were affected by a DELETE, INSERT, REPLACE, or UPDATE statement.

cubrid_query will also fail and return false if the user does not have permission to access the table(s) referenced by the query.

Related Functions

Example of cubrid_query

Show all examples for cubrid_query

PHP Version:

Function cubrid_query:

CUBRID Functions

Most used PHP functions