*cubrid_execute* -- Execute a prepared SQL statement

  resource cubrid_execute(resource conn_identifier, string SQL [, int option])~

  bool cubrid_execute(resource conn_identifier, string SQL [, int option, resource request_identifier [, int option]])~

The |cubrid_execute| function is used to execute the given SQL sentence. It
executes the query by using {conn_identifier} and SQL, and then returns the
request identifier created. It is used for simple execution of query, where
the parameter binding is not needed. In addition, the |cubrid_execute|
function is used to execute the prepared statement by means of
|cubrid_prepare| and |cubrid_bind|. At this time, you need to specify
arguments of {request_identifier} and {option}.

You can use the {option} argument to tell whether to receive oid of the row
after the execution, and, whether to execute the query in asynchronous mode.
You can use it by setting the CUBRID_INCLUDE_OID and CUBRID_ASYNC using
bitwise or operator. If the both variables are not explicitly given, they are
not selected by default.

If the first argument is {request_identifier} to execute the |cubrid_prepare|
function, you can specify an option, CUBRID_ASYNC only.

{conn_identifier} Connection identifier.

{SQL} SQL to be executed.

{option} Query execution option CUBRID_INCLUDE_OID, CUBRID_ASYNC.

{request_identifier} |cubrid_prepare| identifier.

Request identifier, when process is successful and first param is
conn_identifier; TRUE, when process is successful and first argument is
request_identifier.

FALSE, when process is unsuccessful.

|cubrid_execute| example

<?php >
  $conn = cubrid_connect("localhost", 33000, "demodb");
  
  $result = cubrid_execute($conn, "SELECT code FROM event WHERE name='100m Butterfly' and gender='M'", CUBRID_ASYNC);
  $row = cubrid_fetch_array($result, CUBRID_ASSOC);
  $event_code = $row["code"];
  
  cubrid_close_request($result);
  
  $history_req = cubrid_prepare($conn, "SELECT * FROM history WHERE event_code=?");
  cubrid_bind($history_req, 1, $event_code, "number");
  cubrid_execute($history_req);
  
  printf("%-20s %-9s %-10s %-5s\n", "athlete", "host_year", "score", "unit");
  while ($row = cubrid_fetch_array($history_req, CUBRID_ASSOC)) {
      printf("%-20s %-9s %-10s %-5s\n", 
          $row["athlete"], $row["host_year"], $row["score"], $row["unit"]);
  }
  
  cubrid_close_request($history_req);
  
  cubrid_disconnect($conn);
?>

The above example will output:

  athlete              host_year score      unit 
  Phelps Michael       2004      51.25      time

|cubrid_close_request| |cubrid_commit| |cubrid_rollback| |cubrid_prepare|
|cubrid_bind|

vim:ft=help:
