From a598115f4068afb83e86514d86ff75b121034906 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Wed, 13 Apr 2005 00:37:15 +0000 Subject: [PATCH] Add details for db2_exec(). Correct typo in db2_connect(). git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@184243 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/ibm_db2/functions/db2-connect.xml | 4 +- reference/ibm_db2/functions/db2-exec.xml | 206 +++++++++++++------- 2 files changed, 136 insertions(+), 74 deletions(-) diff --git a/reference/ibm_db2/functions/db2-connect.xml b/reference/ibm_db2/functions/db2-connect.xml index c3c493a267..d48f1a1659 100644 --- a/reference/ibm_db2/functions/db2-connect.xml +++ b/reference/ibm_db2/functions/db2-connect.xml @@ -1,5 +1,5 @@ - + @@ -117,7 +117,7 @@ options - An associative array connection options that affect the behavior + An associative array of connection options that affect the behavior of the connection, where valid array keys include: diff --git a/reference/ibm_db2/functions/db2-exec.xml b/reference/ibm_db2/functions/db2-exec.xml index 1beeb7435a..7d40be154c 100644 --- a/reference/ibm_db2/functions/db2-exec.xml +++ b/reference/ibm_db2/functions/db2-exec.xml @@ -1,5 +1,5 @@ - + @@ -13,11 +13,28 @@ resourcedb2_exec resourceconnection - stringstmt_string + stringstatement arrayoptions - &warn.undocumented.func; + &warn.experimental.func; + + + Prepares and executes an SQL statement. + + + If you plan to interpolate PHP variables into the SQL statement, understand + that this is one of the more common security exposures. Consider calling + db2_prepare to prepare an SQL statement with parameter + markers for input values. Then you can call db2_execute + to pass in the input values and avoid SQL injection attacks. + + + If you plan to repeatedly issue the same SQL statement with different + parameters, consider calling db2_prepare and + db2_execute to enable the database server to reuse its + access plan and increase the efficiency of your database access. + @@ -26,90 +43,102 @@ connection - - - Its description - - - + + + A valid database connection resource variable as returned from + db2_connect or db2_pconnect. + + + - stmt_string - - - Its description - - - + statement + + + An SQL statement. + + + options - - - Its description - - - + + + An associative array containing statement options. You can use this + parameter to request a scrollable cursor on database servers that + support this functionality. + + + cursor + + + Passing the DB2_FORWARD_ONLY value requests a + forward-only cursor for this SQL statement. This is the default + type of cursor, and it is supported by all database servers. It is + also much faster than a scrollable cursor. + + + Passing the DB2_SCROLLABLE value requests a + scrollable cursor for this SQL statement. This type of cursor + enables you to fetch rows non-sequentially from the database + server. However, it is only supported by DB2 servers, and is much + slower than forward-only cursors. + + + + + + + + &reftitle.returnvalues; - What the function returns, first on success, then on failure. See - also the &return.success; entity + Returns a statement resource if the SQL statement was issued successfully, + or &false; if the database failed to execute the SQL statement. - - - - - - - -