Skip to content

Commit 8dc684d

Browse files
author
Yoshinari Takaoka
committed
odbc_data_source(): fix refpurpose and return values, and add example
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@350622 c90b9560-bf6c-de11-be94-00142212c4b1
1 parent 2a60d9e commit 8dc684d

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

reference/uodbc/functions/odbc-data-source.xml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 1248359f65f6d21492d8959df4dbe7df2c0f3053 Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: 7990427082721b073c3b64967d945f71746b0b60 Maintainer: takagi Status: ready -->
4+
<!-- Credits: mumumu -->
45
<refentry xml:id="function.odbc-data-source" xmlns="http://docbook.org/ns/docbook">
56
<refnamediv>
67
<refname>odbc_data_source</refname>
7-
<refpurpose>現在の接続についての情報を返す</refpurpose>
8+
<refpurpose>利用可能なDSNについての情報を返す</refpurpose>
89
</refnamediv>
910
<refsect1 role="description">
1011
&reftitle.description;
@@ -47,8 +48,43 @@
4748
&reftitle.returnvalues;
4849
<para>
4950
エラー時には &false;、成功時には配列を返します。
51+
最後の利用可能なDSNを取得した後は、&null; を返します。
5052
</para>
5153
</refsect1>
54+
55+
<refsect1 role="examples">
56+
&reftitle.examples;
57+
<example xml:id="odbc-data-source.example.basic">
58+
<title>利用可能なDSNの一覧を表示する</title>
59+
<programlisting role="php">
60+
<![CDATA[
61+
<?php
62+
$conn = odbc_connect('dsn', 'user', 'pass');
63+
$dsn_info = odbc_data_source($conn, SQL_FETCH_FIRST);
64+
while ($dsn_info) {
65+
print_r($dsn_info);
66+
$dsn_info = odbc_data_source($conn, SQL_FETCH_NEXT);
67+
}
68+
?>
69+
]]>
70+
</programlisting>
71+
&example.outputs.similar;
72+
<screen>
73+
<![CDATA[
74+
Array
75+
(
76+
[server] => dsn
77+
[description] => ODBC Driver 17 for SQL Server
78+
)
79+
Array
80+
(
81+
[server] => other_dsn
82+
[description] => Microsoft Access Driver (*.mdb, *.accdb)
83+
)]]>
84+
</screen>
85+
</example>
86+
</refsect1>
87+
5288
</refentry>
5389

5490
<!-- Keep this comment at the end of the file

0 commit comments

Comments
 (0)