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:
Stefan Livieratos 2000-07-08 11:19:40 +00:00
parent 305206c5a1
commit 6014731ea9
2 changed files with 76 additions and 55 deletions

View file

@ -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, &amp;$errno, &amp;$errstr, 30);
if (!$fp) {
echo "$errstr ($errno)&lt;br&gt;\n";
} else {

View file

@ -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 &amp;<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",&amp;$empno);
OCIDefineByName($stmt,"ENAME",&amp;$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 &amp;<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>
&lt;?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",&amp;$empno,32);
OCIBindByName($stmt,":ename",&amp;$ename,32);
OCIBindByName($stmt,":rid",&amp;$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",&amp;$rowid,-1,OCI_B_ROWID);
OCIBindByName($update,":sal",&amp;$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,&amp;$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 "&lt;/PRE>&lt;/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>
&lt;?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 "&lt;/PRE>&lt;/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",&amp;$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",&amp;$rowid,-1,OCI_B_ROWID);
OCIExecute($delete);
print "$nrows\n";
if ( ($nrows % $commitsize) == 0 ) {
@ -611,7 +615,8 @@ print "&lt;/PRE>&lt;/HTML>";
OCIFreeStatement($stmt);
OCILogoff($conn);
?>
</programlisting><programlisting>
</programlisting>
<programlisting>
&lt;?php
/* This script demonstrates file upload to LOB columns
* The formfield used for this example looks like this
@ -631,7 +636,7 @@ Upload file: &lt;input type="file" name="lob_upload">&lt;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', &amp;$lob, -1, OCI_B_BLOB);
OCIExecute($stmt);
if($lob->savefile($lob_upload)){
OCICommit($conn);
@ -644,8 +649,8 @@ Upload file: &lt;input type="file" name="lob_upload">&lt;br>
OCILogoff($conn);
}
?>
</programlisting></example>
</programlisting>
</example>
</refsect1>
</refentry>
<refentry id="function.ocirowcount">
@ -705,10 +710,12 @@ Upload file: &lt;input type="file" name="lob_upload">&lt;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>
&lt;?php
print "&lt;HTML>&lt;PRE>\n";
$conn = OCILogon("scott", "tiger");
@ -717,7 +724,7 @@ Upload file: &lt;input type="file" name="lob_upload">&lt;br>
while ( OCIFetch($stmt) ) {
print "\n";
$ncols = OCINumCols($stmt);
for ( $i = 1; $i <= $ncols; $i++ ) {
for ( $i = 1; $i &lt;= $ncols; $i++ ) {
$column_name = OCIColumnName($stmt,$i);
$column_value = OCIResult($stmt,$i);
print $column_name . ': ' . $column_value . "\n";
@ -728,8 +735,9 @@ Upload file: &lt;input type="file" name="lob_upload">&lt;br>
OCILogoff($conn);
print "&lt;/PRE>";
print "&lt;/HTML>\n";
?> </programlisting></example>
?>
</programlisting>
</example>
</refsect1>
</refentry>
@ -787,7 +795,7 @@ Upload file: &lt;input type="file" name="lob_upload">&lt;br>
<funcprototype>
<funcdef>int <function>OCIFetchInto</function></funcdef>
<paramdef>int <parameter>stmt</parameter></paramdef>
<paramdef>array &<parameter>result</parameter></paramdef>
<paramdef>array &amp;<parameter>result</parameter></paramdef>
<paramdef>int <parameter><optional>mode</optional></parameter></paramdef>
</funcprototype>
</funcsynopsis>
@ -828,7 +836,7 @@ Upload file: &lt;input type="file" name="lob_upload">&lt;br>
<funcprototype>
<funcdef>int <function>OCIFetchStatement</function></funcdef>
<paramdef>int <parameter>stmt</parameter></paramdef>
<paramdef>array &<parameter>variable</parameter></paramdef>
<paramdef>array &amp;<parameter>variable</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@ -940,7 +948,7 @@ OCILogoff($conn);
print "&lt;TH>Length&lt;/TH>";
print "&lt;/TR>";
$ncols = OCINumCols($stmt);
for ( $i = 1; $i <= $ncols; $i++ ) {
for ( $i = 1; $i &lt;= $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 "&lt;/PRE>";
print "&lt;/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",&amp;$curs,-1,OCI_B_CURSOR);
ociexecute($stmt);
ociexecute($curs);
while (OCIFetchInto($curs,&$data)) {
while (OCIFetchInto($curs,&amp;$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 "&lt;TH>DEPT #&lt;/TH>";
print "&lt;TH># EMPLOYEES&lt;/TH>";
print "&lt;/TR>";
while (OCIFetchInto($stmt,&$data,OCI_ASSOC)) {
while (OCIFetchInto($stmt,&amp;$data,OCI_ASSOC)) {
print "&lt;TR>";
$dname = $data["DNAME"];
$deptno = $data["DEPTNO"];
print "&lt;TD>$dname&lt;/TD>";
print "&lt;TD>$deptno&lt;/TD>";
ociexecute($data[ "EMPCNT" ]);
while (OCIFetchInto($data[ "EMPCNT" ],&$subdata,OCI_ASSOC)) {
while (OCIFetchInto($data[ "EMPCNT" ],&amp;$subdata,OCI_ASSOC)) {
$num_emps = $subdata["NUM_EMPS"];
print "&lt;TD>$num_emps&lt;/TD>";
}
@ -1114,8 +1127,10 @@ print "&lt;/TABLE>";
print "&lt;/BODY>&lt;/HTML>";
OCIFreeStatement($stmt);
OCILogoff($conn);
?></programlisting></example></para>
?>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
@ -1193,7 +1208,7 @@ OCILogoff($conn);
print "&lt;TH>Length&lt;/TH>";
print "&lt;/TR>";
$ncols = OCINumCols($stmt);
for ( $i = 1; $i <= $ncols; $i++ ) {
for ( $i = 1; $i &lt;= $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 "&lt;/PRE>";
print "&lt;/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 "&lt;TH>Length&lt;/TH>";
print "&lt;/TR>";
$ncols = OCINumCols($stmt);
for ( $i = 1; $i <= $ncols; $i++ ) {
for ( $i = 1; $i &lt;= $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 "&lt;/PRE>";
print "&lt;/HTML>\n";
?> </programlisting></example></para>
?>
</programlisting>
</example>
</para>
<simpara>
See also <function>OCINumCols</function>, <function>OCIColumnName</function>,
and <function>OCIColumnSize</function>.</simpara>