mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Nuke bogus ibase_num_fields() example
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@139387 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
0f9bfa3b2f
commit
f78ca5039b
1 changed files with 10 additions and 13 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue