source: www/manuals/PHP_manual/function.odbc-setoption.html@ 1

Last change on this file since 1 was 1, checked in by george, 17 years ago

Prvotní import všeho

File size: 4.8 KB
Line 
1<HTML
2><HEAD
3><TITLE
4>odbc_setoption</TITLE
5><META
6NAME="GENERATOR"
7CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
8REL="HOME"
9TITLE="Manuál PHP"
10HREF="index.html"><LINK
11REL="UP"
12TITLE="Unified ODBC functions"
13HREF="ref.odbc.html"><LINK
14REL="PREVIOUS"
15TITLE="odbc_rollback"
16HREF="function.odbc-rollback.html"><LINK
17REL="NEXT"
18TITLE="odbc_specialcolumns"
19HREF="function.odbc-specialcolumns.html"><META
20HTTP-EQUIV="Content-type"
21CONTENT="text/html; charset=ISO-8859-2"></HEAD
22><BODY
23CLASS="refentry"
24BGCOLOR="#FFFFFF"
25TEXT="#000000"
26LINK="#0000FF"
27VLINK="#840084"
28ALINK="#0000FF"
29><DIV
30CLASS="NAVHEADER"
31><TABLE
32SUMMARY="Header navigation table"
33WIDTH="100%"
34BORDER="0"
35CELLPADDING="0"
36CELLSPACING="0"
37><TR
38><TH
39COLSPAN="3"
40ALIGN="center"
41>Manuál PHP</TH
42></TR
43><TR
44><TD
45WIDTH="10%"
46ALIGN="left"
47VALIGN="bottom"
48><A
49HREF="function.odbc-rollback.html"
50ACCESSKEY="P"
51>Pøedcházející</A
52></TD
53><TD
54WIDTH="80%"
55ALIGN="center"
56VALIGN="bottom"
57></TD
58><TD
59WIDTH="10%"
60ALIGN="right"
61VALIGN="bottom"
62><A
63HREF="function.odbc-specialcolumns.html"
64ACCESSKEY="N"
65>Dal¹í</A
66></TD
67></TR
68></TABLE
69><HR
70ALIGN="LEFT"
71WIDTH="100%"></DIV
72><H1
73><A
74NAME="function.odbc-setoption"
75></A
76>odbc_setoption</H1
77><DIV
78CLASS="refnamediv"
79><A
80NAME="AEN61052"
81></A
82><P
83> (PHP 3&#62;= 3.0.6, PHP 4 )</P
84>odbc_setoption&nbsp;--&nbsp;
85 Adjust ODBC settings. Returns <TT
86CLASS="constant"
87><B
88>FALSE</B
89></TT
90> if an error occurs, otherwise
91 <TT
92CLASS="constant"
93><B
94>TRUE</B
95></TT
96>.
97 </DIV
98><DIV
99CLASS="refsect1"
100><A
101NAME="AEN61057"
102></A
103><H2
104>Description</H2
105>int <B
106CLASS="methodname"
107>odbc_setoption</B
108> ( resource id, int function, int option, int param)<BR
109></BR
110><P
111>&#13; This function allows fiddling with the ODBC options for a
112 particular connection or query result. It was written to help
113 find work arounds to problems in quirky ODBC drivers. You should
114 probably only use this function if you are an ODBC programmer and
115 understand the effects the various options will have. You will
116 certainly need a good ODBC reference to explain all the different
117 options and values that can be used. Different driver versions
118 support different options.
119 </P
120><P
121>&#13; Because the effects may vary depending on the ODBC driver, use of
122 this function in scripts to be made publicly available is
123 strongly discouraged. Also, some ODBC options are not available
124 to this function because they must be set before the connection
125 is established or the query is prepared. However, if on a
126 particular job it can make PHP work so your boss doesn't tell you
127 to use a commercial product, that's all that really
128 matters.
129 </P
130><P
131>&#13; <TT
132CLASS="parameter"
133><I
134>id</I
135></TT
136> is a connection id or result id on
137 which to change the settings.For SQLSetConnectOption(), this is a
138 connection id. For SQLSetStmtOption(), this is a result
139 id.
140 </P
141><P
142>&#13; <TT
143CLASS="parameter"
144><I
145>Function</I
146></TT
147> is the ODBC function to use. The
148 value should be 1 for SQLSetConnectOption() and 2 for
149 SQLSetStmtOption().
150 </P
151><P
152>&#13; Parameter <TT
153CLASS="parameter"
154><I
155>option</I
156></TT
157> is the option to set.</P
158><P
159>&#13; Parameter <TT
160CLASS="parameter"
161><I
162>param</I
163></TT
164> is the value for the
165 given <TT
166CLASS="parameter"
167><I
168>option</I
169></TT
170>.
171 <TABLE
172WIDTH="100%"
173BORDER="0"
174CELLPADDING="0"
175CELLSPACING="0"
176CLASS="EXAMPLE"
177><TR
178><TD
179><DIV
180CLASS="example"
181><A
182NAME="AEN61085"
183></A
184><P
185><B
186>Pøíklad 1. ODBC Setoption Examples</B
187></P
188><TABLE
189BORDER="0"
190BGCOLOR="#E0E0E0"
191CELLPADDING="5"
192><TR
193><TD
194><PRE
195CLASS="php"
196>// 1. Option 102 of SQLSetConnectOption() is SQL_AUTOCOMMIT.
197// Value 1 of SQL_AUTOCOMMIT is SQL_AUTOCOMMIT_ON.
198// This example has the same effect as
199// odbc_autocommit($conn, true);
200
201odbc_setoption ($conn, 1, 102, 1);
202
203// 2. Option 0 of SQLSetStmtOption() is SQL_QUERY_TIMEOUT.
204// This example sets the query to timeout after 30 seconds.
205
206$result = odbc_prepare ($conn, $sql);
207odbc_setoption ($result, 2, 0, 30);
208odbc_execute ($result);</PRE
209></TD
210></TR
211></TABLE
212></DIV
213></TD
214></TR
215></TABLE
216>
217 </P
218></DIV
219><DIV
220CLASS="NAVFOOTER"
221><HR
222ALIGN="LEFT"
223WIDTH="100%"><TABLE
224SUMMARY="Footer navigation table"
225WIDTH="100%"
226BORDER="0"
227CELLPADDING="0"
228CELLSPACING="0"
229><TR
230><TD
231WIDTH="33%"
232ALIGN="left"
233VALIGN="top"
234><A
235HREF="function.odbc-rollback.html"
236ACCESSKEY="P"
237>Pøedcházející</A
238></TD
239><TD
240WIDTH="34%"
241ALIGN="center"
242VALIGN="top"
243><A
244HREF="index.html"
245ACCESSKEY="H"
246>Domù</A
247></TD
248><TD
249WIDTH="33%"
250ALIGN="right"
251VALIGN="top"
252><A
253HREF="function.odbc-specialcolumns.html"
254ACCESSKEY="N"
255>Dal¹í</A
256></TD
257></TR
258><TR
259><TD
260WIDTH="33%"
261ALIGN="left"
262VALIGN="top"
263>odbc_rollback</TD
264><TD
265WIDTH="34%"
266ALIGN="center"
267VALIGN="top"
268><A
269HREF="ref.odbc.html"
270ACCESSKEY="U"
271>Nahoru</A
272></TD
273><TD
274WIDTH="33%"
275ALIGN="right"
276VALIGN="top"
277>odbc_specialcolumns</TD
278></TR
279></TABLE
280></DIV
281></BODY
282></HTML
283>
Note: See TracBrowser for help on using the repository browser.