abies Mon Sep 1 12:58:05 2003 EDT
Modified files:
/phpdoc/en/reference/ibase/functions ibase-num-fields.xml
Log:
Nuke bogus ibase_num_fields() example
Index: phpdoc/en/reference/ibase/functions/ibase-num-fields.xml
diff -u phpdoc/en/reference/ibase/functions/ibase-num-fields.xml:1.3
phpdoc/en/reference/ibase/functions/ibase-num-fields.xml:1.4
--- phpdoc/en/reference/ibase/functions/ibase-num-fields.xml:1.3 Sun Jul 27
18:21:30 2003
+++ phpdoc/en/reference/ibase/functions/ibase-num-fields.xml Mon Sep 1 12:58:05
2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/ibase.xml, last change in rev 1.12 -->
<refentry id="function.ibase-num-fields">
<refnamediv>
@@ -21,19 +21,16 @@
<programlisting role="php">
<![CDATA[
<?php
- $dbh = ibase_connect ($host, $username, $password);
- $stmt = 'SELECT * FROM tblname';
- $sth = ibase_query ($dbh, $stmt);
-
- if (ibase_num_fields($sth) > 0) {
- while ($row = ibase_fetch_object ($sth)) {
- print $row->email . "\n";
- }
- } else {
- die ("No Results were found for your query");
+ $rs = ibase_query("SELECT * FROM tablename");
+ $coln = ibase_num_fields($rs);
+ for ($i = 0; $i < $coln; $i++) {
+ $col_info = ibase_field_info($rs, $i);
+ echo "name: ".$col_info['name']."\n";
+ echo "alias: ".$col_info['alias']."\n";
+ echo "relation: ".$col_info['relation']."\n";
+ echo "length: ".$col_info['length']."\n";
+ echo "type: ".$col_info['type']."\n";
}
-
- ibase_close ($dbh);
?>
]]>
</programlisting>