From b6093f02caf17a35b75c19715f6d448747cf8234 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Wed, 11 Nov 2009 01:01:39 +0000 Subject: [PATCH] Add example and correct grammar git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@290495 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/oci8/functions/oci-parse.xml | 57 +++++++++++++++++++------- 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/reference/oci8/functions/oci-parse.xml b/reference/oci8/functions/oci-parse.xml index 5c9c7bfafe..8e6d542836 100644 --- a/reference/oci8/functions/oci-parse.xml +++ b/reference/oci8/functions/oci-parse.xml @@ -3,7 +3,7 @@ oci_parse - Prepares Oracle statement for execution + Prepares an Oracle statement for execution @@ -11,10 +11,10 @@ resourceoci_parse resourceconnection - stringquery + stringsql_text - Prepares the queryusing + Prepares the sql_textusing connection and returns the statement identifier, which can be used with oci_bind_by_name, oci_execute and other functions. @@ -30,15 +30,15 @@ An Oracle connection identifier, returned by - oci_connect or oci_pconnect. + oci_connect, oci_pconnect, or oci_new_connect. - query + sql_text - The SQL query. + The SQL or PL/SQL statement. @@ -49,7 +49,38 @@ &reftitle.returnvalues; - Returns a statement handler on success, or &false; on error. + Returns a statement handle on success, or &false; on error. + + + + + &reftitle.examples; + + + <function>oci_parse</function> example + +\n"; +while ($row = oci_fetch_array($statement, OCI_ASSOC+OCI_RETURN_NULLS)) { + echo "\n"; + foreach ($row as $item) { + echo " ".($item!==null?htmlentities($item, ENT_QUOTES):" ")."\n"; + } + echo "\n"; +} +echo "\n"; + +?> +]]> + + @@ -58,17 +89,15 @@ This function does not validate - query. The only way to find out if - query is valid SQL or PL/SQL statement - is to - execute it. + sql_text. The only way to find out if + sql_text is a valid SQL or PL/SQL statement + is to execute it. - In PHP versions before 5.0.0 you must use ociparse instead. - This name still can be used, it was left as alias of - oci_parse for downwards compatability. - This, however, is deprecated and not recommended. + In PHP versions before 5.0.0 you must + use ociparse instead. &oci.name.compat.note;