mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
Small corrections and cosmetic changes
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@27865 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
305206c5a1
commit
6014731ea9
2 changed files with 76 additions and 55 deletions
|
@ -173,7 +173,7 @@
|
|||
<example>
|
||||
<title><function>Fsockopen</function> Example</title>
|
||||
<programlisting role="php">
|
||||
$fp = fsockopen ("www.php.net", 80, &$errno, &$errstr, 30);
|
||||
$fp = fsockopen ("www.php.net", 80, &$errno, &$errstr, 30);
|
||||
if (!$fp) {
|
||||
echo "$errstr ($errno)<br>\n";
|
||||
} else {
|
||||
|
|
|
@ -60,7 +60,7 @@ OCIFreeCursor
|
|||
<funcdef>int <function>OCIDefineByName</function></funcdef>
|
||||
<paramdef>int <parameter>stmt</parameter></paramdef>
|
||||
<paramdef>string <parameter>Column-Name</parameter></paramdef>
|
||||
<paramdef>mixed &<parameter>variable</parameter></paramdef>
|
||||
<paramdef>mixed &<parameter>variable</parameter></paramdef>
|
||||
<paramdef>int <parameter><optional>type</optional></parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
|
@ -91,8 +91,8 @@ $stmt = OCIParse($conn,"select empno, ename from emp");
|
|||
|
||||
/* the define MUST be done BEFORE ociexecute! */
|
||||
|
||||
OCIDefineByName($stmt,"EMPNO",&$empno);
|
||||
OCIDefineByName($stmt,"ENAME",&$ename);
|
||||
OCIDefineByName($stmt,"EMPNO",&$empno);
|
||||
OCIDefineByName($stmt,"ENAME",&$ename);
|
||||
|
||||
OCIExecute($stmt);
|
||||
|
||||
|
@ -103,8 +103,9 @@ while (OCIFetch($stmt)) {
|
|||
|
||||
OCIFreeStatement($stmt);
|
||||
OCILogoff($conn);
|
||||
?></programlisting></example>
|
||||
|
||||
?>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
@ -120,7 +121,7 @@ OCILogoff($conn);
|
|||
<funcdef>int <function>OCIBindByName</function></funcdef>
|
||||
<paramdef>int <parameter>stmt</parameter></paramdef>
|
||||
<paramdef>string <parameter>ph_name</parameter></paramdef>
|
||||
<paramdef>mixed &<parameter>variable</parameter></paramdef>
|
||||
<paramdef>mixed &<parameter>variable</parameter></paramdef>
|
||||
<paramdef>int<parameter>length</parameter></paramdef>
|
||||
<paramdef>int <parameter><optional>type</optional></parameter></paramdef>
|
||||
</funcprototype>
|
||||
|
@ -147,9 +148,9 @@ OCILogoff($conn);
|
|||
(Character-File), OCI_B_CLOB (Character-LOB), OCI_B_BLOB
|
||||
(Binary-LOB) and OCI_B_ROWID (ROWID).
|
||||
</para>
|
||||
<example>
|
||||
<title>OCIDefineByName</title>
|
||||
<programlisting>
|
||||
<example>
|
||||
<title>OCIDefineByName</title>
|
||||
<programlisting>
|
||||
<?php
|
||||
/* OCIBindByPos example thies@digicol.de (980221)
|
||||
|
||||
|
@ -167,13 +168,13 @@ $data = array(1111 => "Larry", 2222 => "Bill", 3333 => "Jim");
|
|||
|
||||
$rowid = OCINewDescriptor($conn,OCI_D_ROWID);
|
||||
|
||||
OCIBindByName($stmt,":empno",&$empno,32);
|
||||
OCIBindByName($stmt,":ename",&$ename,32);
|
||||
OCIBindByName($stmt,":rid",&$rowid,-1,OCI_B_ROWID);
|
||||
OCIBindByName($stmt,":empno",&$empno,32);
|
||||
OCIBindByName($stmt,":ename",&$ename,32);
|
||||
OCIBindByName($stmt,":rid",&$rowid,-1,OCI_B_ROWID);
|
||||
|
||||
$update = OCIParse($conn,"update emp set sal = :sal where ROWID = :rid");
|
||||
OCIBindByName($update,":rid",&$rowid,-1,OCI_B_ROWID);
|
||||
OCIBindByName($update,":sal",&$sal,32);
|
||||
OCIBindByName($update,":rid",&$rowid,-1,OCI_B_ROWID);
|
||||
OCIBindByName($update,":sal",&$sal,32);
|
||||
|
||||
$sal = 10000;
|
||||
|
||||
|
@ -189,7 +190,7 @@ OCIFreeStatement($stmt);
|
|||
|
||||
$stmt = OCIParse($conn,"select * from emp where empno in (1111,2222,3333)");
|
||||
OCIExecute($stmt);
|
||||
while (OCIFetchInto($stmt,&$arr,OCI_ASSOC)) {
|
||||
while (OCIFetchInto($stmt,&$arr,OCI_ASSOC)) {
|
||||
var_dump($arr);
|
||||
}
|
||||
OCIFreeStatement($stmt);
|
||||
|
@ -200,10 +201,12 @@ OCIExecute($stmt);
|
|||
OCIFreeStatement($stmt);
|
||||
|
||||
OCILogoff($conn);
|
||||
?></programlisting></example>
|
||||
?>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
||||
<refentry id="function.ocilogon">
|
||||
<refnamediv>
|
||||
<refname>OCILogon</refname>
|
||||
|
@ -575,15 +578,16 @@ print "</PRE></HTML>";
|
|||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<function>OCINewDescriptor</function> Allocates storage to hold descriptors or LOB locators.
|
||||
Valid values for the valid <parameter>type</parameter> are OCI_D_FILE, OCI_D_LOB, OCI_D_ROWID.
|
||||
For LOB desriptors, the methods load, save, and savefile are associated with the descriptor,
|
||||
for BFILE only the load method exists. See the second example usage hints.
|
||||
|
||||
<function>OCINewDescriptor</function> Allocates storage to hold
|
||||
descriptors or LOB locators. Valid values for the valid
|
||||
<parameter>type</parameter> are OCI_D_FILE, OCI_D_LOB, OCI_D_ROWID.
|
||||
For LOB desriptors, the methods load, save, and savefile are
|
||||
associated with the descriptor, for BFILE only the load method exists.
|
||||
See the second example usage hints.
|
||||
</para>
|
||||
<example>
|
||||
<title>OCINewDescriptor</title>
|
||||
<programlisting>
|
||||
<example>
|
||||
<title>OCINewDescriptor</title>
|
||||
<programlisting>
|
||||
<?php
|
||||
/* This script is designed to be called from a HTML form.
|
||||
* It expects $user, $password, $table, $where, and $commitsize
|
||||
|
@ -594,12 +598,12 @@ print "</PRE></HTML>";
|
|||
$conn = OCILogon($user, $password);
|
||||
$stmt = OCIParse($conn,"select rowid from $table $where");
|
||||
$rowid = OCINewDescriptor($conn,OCI_D_ROWID);
|
||||
OCIDefineByName($stmt,"ROWID",&$rowid);
|
||||
OCIDefineByName($stmt,"ROWID",&$rowid);
|
||||
OCIExecute($stmt);
|
||||
while ( OCIFetch($stmt) ) {
|
||||
$nrows = OCIRowCount($stmt);
|
||||
$delete = OCIParse($conn,"delete from $table where ROWID = :rid");
|
||||
OCIBindByName($delete,":rid",&$rowid,-1,OCI_B_ROWID);
|
||||
OCIBindByName($delete,":rid",&$rowid,-1,OCI_B_ROWID);
|
||||
OCIExecute($delete);
|
||||
print "$nrows\n";
|
||||
if ( ($nrows % $commitsize) == 0 ) {
|
||||
|
@ -611,7 +615,8 @@ print "</PRE></HTML>";
|
|||
OCIFreeStatement($stmt);
|
||||
OCILogoff($conn);
|
||||
?>
|
||||
</programlisting><programlisting>
|
||||
</programlisting>
|
||||
<programlisting>
|
||||
<?php
|
||||
/* This script demonstrates file upload to LOB columns
|
||||
* The formfield used for this example looks like this
|
||||
|
@ -631,7 +636,7 @@ Upload file: <input type="file" name="lob_upload"><br>
|
|||
$conn = OCILogon($user, $password);
|
||||
$lob = OCINewDescriptor($conn, OCI_D_LOB);
|
||||
$stmt = OCIParse($conn,"insert into $table (id, the_blob) values(my_seq.NEXTVAL, EMPTY_BLOB()) returning the_blob into :the_blob");
|
||||
OCIBindByName($stmt, ':the_blob', &$lob, -1, OCI_B_BLOB);
|
||||
OCIBindByName($stmt, ':the_blob', &$lob, -1, OCI_B_BLOB);
|
||||
OCIExecute($stmt);
|
||||
if($lob->savefile($lob_upload)){
|
||||
OCICommit($conn);
|
||||
|
@ -644,8 +649,8 @@ Upload file: <input type="file" name="lob_upload"><br>
|
|||
OCILogoff($conn);
|
||||
}
|
||||
?>
|
||||
</programlisting></example>
|
||||
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<refentry id="function.ocirowcount">
|
||||
|
@ -705,10 +710,12 @@ Upload file: <input type="file" name="lob_upload"><br>
|
|||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<function>OCINumCols</function> returns the number of columns in a statement</para>
|
||||
<example>
|
||||
<title>OCINumCols</title>
|
||||
<programlisting>
|
||||
<function>OCINumCols</function> returns the number of columns in a
|
||||
statement
|
||||
</para>
|
||||
<example>
|
||||
<title>OCINumCols</title>
|
||||
<programlisting>
|
||||
<?php
|
||||
print "<HTML><PRE>\n";
|
||||
$conn = OCILogon("scott", "tiger");
|
||||
|
@ -717,7 +724,7 @@ Upload file: <input type="file" name="lob_upload"><br>
|
|||
while ( OCIFetch($stmt) ) {
|
||||
print "\n";
|
||||
$ncols = OCINumCols($stmt);
|
||||
for ( $i = 1; $i <= $ncols; $i++ ) {
|
||||
for ( $i = 1; $i <= $ncols; $i++ ) {
|
||||
$column_name = OCIColumnName($stmt,$i);
|
||||
$column_value = OCIResult($stmt,$i);
|
||||
print $column_name . ': ' . $column_value . "\n";
|
||||
|
@ -728,8 +735,9 @@ Upload file: <input type="file" name="lob_upload"><br>
|
|||
OCILogoff($conn);
|
||||
print "</PRE>";
|
||||
print "</HTML>\n";
|
||||
?> </programlisting></example>
|
||||
|
||||
?>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
@ -787,7 +795,7 @@ Upload file: <input type="file" name="lob_upload"><br>
|
|||
<funcprototype>
|
||||
<funcdef>int <function>OCIFetchInto</function></funcdef>
|
||||
<paramdef>int <parameter>stmt</parameter></paramdef>
|
||||
<paramdef>array &<parameter>result</parameter></paramdef>
|
||||
<paramdef>array &<parameter>result</parameter></paramdef>
|
||||
<paramdef>int <parameter><optional>mode</optional></parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
|
@ -828,7 +836,7 @@ Upload file: <input type="file" name="lob_upload"><br>
|
|||
<funcprototype>
|
||||
<funcdef>int <function>OCIFetchStatement</function></funcdef>
|
||||
<paramdef>int <parameter>stmt</parameter></paramdef>
|
||||
<paramdef>array &<parameter>variable</parameter></paramdef>
|
||||
<paramdef>array &<parameter>variable</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
|
@ -940,7 +948,7 @@ OCILogoff($conn);
|
|||
print "<TH>Length</TH>";
|
||||
print "</TR>";
|
||||
$ncols = OCINumCols($stmt);
|
||||
for ( $i = 1; $i <= $ncols; $i++ ) {
|
||||
for ( $i = 1; $i <= $ncols; $i++ ) {
|
||||
$column_name = OCIColumnName($stmt,$i);
|
||||
$column_type = OCIColumnType($stmt,$i);
|
||||
$column_size = OCIColumnSize($stmt,$i);
|
||||
|
@ -955,7 +963,10 @@ OCILogoff($conn);
|
|||
OCILogoff($conn);
|
||||
print "</PRE>";
|
||||
print "</HTML>\n";
|
||||
?> </programlisting></example></para>
|
||||
?>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<simpara>
|
||||
See also <function>OCINumCols</function>, <function>OCIColumnName</function>,
|
||||
and <function>OCIColumnSize</function>.</simpara>
|
||||
|
@ -1065,19 +1076,21 @@ $conn = OCILogon("scott","tiger");
|
|||
$curs = OCINewCursor($conn);
|
||||
$stmt = OCIParse($conn,"begin info.output(:data); end;");
|
||||
|
||||
ocibindbyname($stmt,"data",&$curs,-1,OCI_B_CURSOR);
|
||||
ocibindbyname($stmt,"data",&$curs,-1,OCI_B_CURSOR);
|
||||
ociexecute($stmt);
|
||||
ociexecute($curs);
|
||||
|
||||
while (OCIFetchInto($curs,&$data)) {
|
||||
while (OCIFetchInto($curs,&$data)) {
|
||||
var_dump($data);
|
||||
}
|
||||
|
||||
OCIFreeCursor($stmt);
|
||||
OCIFreeStatement($curs);
|
||||
OCILogoff($conn);
|
||||
?></programlisting></example></para>
|
||||
|
||||
?>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Using a REF CURSOR in a select statement</title>
|
||||
|
@ -1097,14 +1110,14 @@ print "<TH>DEPT #</TH>";
|
|||
print "<TH># EMPLOYEES</TH>";
|
||||
print "</TR>";
|
||||
|
||||
while (OCIFetchInto($stmt,&$data,OCI_ASSOC)) {
|
||||
while (OCIFetchInto($stmt,&$data,OCI_ASSOC)) {
|
||||
print "<TR>";
|
||||
$dname = $data["DNAME"];
|
||||
$deptno = $data["DEPTNO"];
|
||||
print "<TD>$dname</TD>";
|
||||
print "<TD>$deptno</TD>";
|
||||
ociexecute($data[ "EMPCNT" ]);
|
||||
while (OCIFetchInto($data[ "EMPCNT" ],&$subdata,OCI_ASSOC)) {
|
||||
while (OCIFetchInto($data[ "EMPCNT" ],&$subdata,OCI_ASSOC)) {
|
||||
$num_emps = $subdata["NUM_EMPS"];
|
||||
print "<TD>$num_emps</TD>";
|
||||
}
|
||||
|
@ -1114,8 +1127,10 @@ print "</TABLE>";
|
|||
print "</BODY></HTML>";
|
||||
OCIFreeStatement($stmt);
|
||||
OCILogoff($conn);
|
||||
?></programlisting></example></para>
|
||||
|
||||
?>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
@ -1193,7 +1208,7 @@ OCILogoff($conn);
|
|||
print "<TH>Length</TH>";
|
||||
print "</TR>";
|
||||
$ncols = OCINumCols($stmt);
|
||||
for ( $i = 1; $i <= $ncols; $i++ ) {
|
||||
for ( $i = 1; $i <= $ncols; $i++ ) {
|
||||
$column_name = OCIColumnName($stmt,$i);
|
||||
$column_type = OCIColumnType($stmt,$i);
|
||||
$column_size = OCIColumnSize($stmt,$i);
|
||||
|
@ -1207,7 +1222,10 @@ OCILogoff($conn);
|
|||
OCILogoff($conn);
|
||||
print "</PRE>";
|
||||
print "</HTML>\n";
|
||||
?> </programlisting></example></para>
|
||||
?>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<simpara>
|
||||
See also <function>OCINumCols</function>, <function>OCIColumnType</function>,
|
||||
and <function>OCIColumnSize</function>.</simpara>
|
||||
|
@ -1248,7 +1266,7 @@ OCILogoff($conn);
|
|||
print "<TH>Length</TH>";
|
||||
print "</TR>";
|
||||
$ncols = OCINumCols($stmt);
|
||||
for ( $i = 1; $i <= $ncols; $i++ ) {
|
||||
for ( $i = 1; $i <= $ncols; $i++ ) {
|
||||
$column_name = OCIColumnName($stmt,$i);
|
||||
$column_type = OCIColumnType($stmt,$i);
|
||||
$column_size = OCIColumnSize($stmt,$i);
|
||||
|
@ -1262,7 +1280,10 @@ OCILogoff($conn);
|
|||
OCILogoff($conn);
|
||||
print "</PRE>";
|
||||
print "</HTML>\n";
|
||||
?> </programlisting></example></para>
|
||||
?>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<simpara>
|
||||
See also <function>OCINumCols</function>, <function>OCIColumnName</function>,
|
||||
and <function>OCIColumnSize</function>.</simpara>
|
||||
|
|
Loading…
Reference in a new issue