1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582
|
<?xml version="1.0" encoding="utf-8"?>
<!-- edited with XML Spy v3.0.7 NT (http://www.xmlspy.com) by karoora (karoora) -->
<reference id="ref.ibase">
<title>InterBase 함수</title>
<titleabbrev>InterBase</titleabbrev>
<partintro>
<para>
인터베이스는 Borland/Inprise에 의해 내 놓은 유명한 데이터베이스이다. 보다 많은 인터베이스에 관한 정보가 필요하다면<ulink url="&url.ibase;">&url.ibase;</ulink>에서 찾아 볼 수 있다. 게다가 인터베이스는 오픈 소스 운동에 참가하게 되었다!
</para>
<note>
<para>
PHP 4.0에서는 인터베이스에 관한 모든 지원이 추가 되었다.
</para>
<para>
이 데이터베이스는 따옴표(a single quote ('))를 escaping문자로 사용하며, behavior는 Sybase database와 유사하다. <filename>php.ini</filename>파일에서 다음과 같이 설정한다.:
<informalexample>
<programlisting>
magic_quotes_sybase = On
</programlisting>
</informalexample>
</para>
</note>
</partintro>
<refentry id="function.ibase-connect">
<refnamediv>
<refname>ibase_connect</refname>
<refpurpose>
InterBase database와 연결을 설정한다.
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>ibase_connect</methodname>
<methodparam><type>string</type><parameter>database</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>
username
</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>
password
</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>
charset
</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>
buffers
</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>
dialect
</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>
role
</parameter></methodparam>
</methodsynopsis>
<para>
InterBase server와의 연결을 설정한다.
<parameter>database</parameter>인수는 서버에 위치한 데이터베이스의 유효한 파일경로를 가진다.(역주:현재 win32용 ODBC드라이버가 존재한다. 이것은 Iterbase 5.x용이지만 별 에러업ㅅ이 잘 작동한다.)
만일 로컬 서버가 아닌 경우에는, 사용된 연결 프로토콜에 의존하는 'hostname:' (TCP/IP), '//hostname/' (NetBEUI) 또는 'hostname@' (IPX/SPX),
를 먼저 추가해 주어야 한다. <parameter>username</parameter>
and <parameter>password</parameter> 는 PHP 설정 부분의 ibase항목에서 ibase.default_user 와 ibase.default_password에 기록할 수 있다. . <parameter>charset</parameter>은 데이터베이스 서버 무자셋의 디폴트 값을 나타낸다.
<parameter>buffers</parameter>는 server-side cache에 할당되는 database buffers의 수이다. 만일 0인 경우나 생략된 경우에는, 서버자신의 설정된 값으로 선택된다.
<parameter>dialect</parameter>는 연결되는 동안 실행되는 어떠한 구문의 특정 SQL값의 기본 값을 선택하는데, 그 기본값은(즉, 값이 주어지지 않은 경우)
클라이언트 라이브러리가 지원하는 최상의 것으로 한다.
</para>
<para>
같은 인자들을 사용한<function>ibase_connect</function>의 두번째 호출의 경우에는, 새로운 link를 설정하지 않고,
대신에 이미 연결된 link의 식별자를 리턴하게 된다. 서버의 link는 <function>ibase_close</function>가 호출되어 연결이 닫히지 않는한,
스크립트의 종료태그를 만나면 곧 닫히게 된다.
<example>
<title>
<function>ibase_connect</function> example</title>
<programlisting role="php">
<?php
$dbh = ibase_connect ($host, $username, $password);
$stmt = 'SELECT * FROM tblname';
$sth = ibase_query ($dbh, $stmt);
while ($row = ibase_fetch_object ($sth)) {
print $row->email . "\n";
}
ibase_close ($dbh);
?>
</programlisting>
</example>
</para>
<note>
<para>
<parameter>buffers</parameter>는 PHP4-RC2에서 추가되었다.
</para>
</note>
<note>
<para>
<parameter>dialect</parameter>는 PHP4-RC2에서 추가되었다. 이것은 InterBase 6.0 versions 또는 그 상위 버젼에서 작동한다.
</para>
</note>
<note>
<para>
<parameter>role</parameter>는 PHP4-RC2에서 추가되었다. 이것은 InterBase 5 versions 또는 그 상위 버젼에서 작동한다.
</para>
</note>
<para>
참고 : <function>ibase_pconnect</function>.
</para>
</refsect1>
</refentry>
<refentry id="function.ibase-pconnect">
<refnamediv>
<refname>ibase_pconnect</refname>
<refpurpose>
InterBase database의 영속적인 연결을 생성한다.
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>ibase_pconnect</methodname>
<methodparam><type>string</type><parameter>database</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>
username
</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>
password
</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>
charset
</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>
buffers
</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>
dialect
</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>
role
</parameter></methodparam>
</methodsynopsis>
<para>
<function>ibase_pconnect</function>의 동작은 <function>ibase_connect</function>와 유사하나 두 가지의 중요한 차이가 있다.
첫째로, 연결될때, 이 함수는 첫째로 이미 동일한 인자들로 열린 (persistent) link를 찾을 것이다.
만일 발견이 된다면, 새로운 연결을 여는 대신에 이전의 식별자를 리턴하게 된다.
둘째로, InterBase server의 연결이 나중에 이용되기 위하여 스크립트의 종료태그를 만나도 닫히지 않는다.
(<function>ibase_close</function>은 <function>ibase_pconnect</function>에 의해 설정된 연결을 닫을 수 없다). 이러한 연결의 타입이 'persistent'라 불리운다.
</para>
<note>
<para>
<parameter>buffers</parameter>는 PHP4-RC2에서 추가되었다.
</para>
</note>
<note>
<para>
<parameter>dialect</parameter> 는 PHP4-RC2에서 추가되었다. 이것은 InterBase 6.0 versions 또는 그 상위 버젼에서 작동한다.
</para>
</note>
<note>
<para>
<parameter>role</parameter>는 PHP4-RC2에서 추가되었다. 이것은 InterBase 5 versions 또는 그 상위 버젼에서 작동한다.
</para>
</note>
<para>
이 함수의 인자는 이전의 <function>ibase_connect</function>와 동일하다
</para>
</refsect1>
</refentry>
<refentry id="function.ibase-close">
<refnamediv>
<refname>ibase_close</refname>
<refpurpose>
InterBase database의 연결을 닫는다.
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>ibase_close</methodname>
<methodparam choice="opt"><type>int</type><parameter>
connection_id
</parameter></methodparam>
</methodsynopsis>
<para>
<function>ibase_connect</function>로 부터 리턴된 연결 식별자가 나타내는 InterBase database의 연결을 닫는다.
만일 연결 식별자가 생략된 경우에는 가장 나중에 열린 연결로 간주한다. 링크의 기본 transaction을 실행하고,
나머지 다른 transaction들을 되돌린다.
</para>
</refsect1>
</refentry>
<refentry id="function.ibase-query">
<refnamediv>
<refname>ibase_query</refname>
<refpurpose>InterBase database의 쿼리를 실행한다</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>ibase_query</methodname>
<methodparam choice="opt"><type>int</type><parameter>
link_identifier
</parameter></methodparam>
<methodparam><type>string</type><parameter>query</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>
bind_args
</parameter></methodparam>
</methodsynopsis>
<simpara>
InterBase database의 쿼리를 실행하고, <function>ibase_fetch_row</function>,
<function>ibase_fetch_object</function>,
<function>ibase_free_result</function>와
<function>ibase_free_query</function>의 실행에 사용되는 식별자를 리턴한다.
</simpara>
<note>
<para>
Although this function supports variable binding to parameter
placeholders, there is not very much meaning using this capability
with it. For real life use and an example, see
<function>ibase_prepare</function> and
<function>ibase_execute</function>.
</para>
</note>
</refsect1>
</refentry>
<refentry id="function.ibase-fetch-row">
<refnamediv>
<refname>ibase_fetch_row</refname>
<refpurpose>InterBase database부터 열을 가지고 온다</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>ibase_fetch_row</methodname>
<methodparam><type>int</type><parameter>result_identifier</parameter></methodparam>
</methodsynopsis>
<simpara>
<function>ibase_query</function>를 사용하여 얻어진 결과 식별자에 의해 기록된 다음 열을 가지고 온다.
</simpara>
</refsect1>
</refentry>
<refentry id="function.ibase-fetch-object">
<refnamediv>
<refname>ibase_fetch_object</refname>
<refpurpose>InterBase database로 부터 객체를 얻는다.</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>object</type><methodname>ibase_fetch_object</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
</methodsynopsis>
<para>
<function>ibase_query</function> 또는 <function>ibase_execute</function>에 의해 얻어진 <parameter>result_id</parameter>로 부터의 pseudo-object의 열을 가지고 온다.
<informalexample>
<programlisting role="php">
<php
$dbh = ibase_connect ($host, $username, $password);
$stmt = 'SELECT * FROM tblname';
$sth = ibase_query ($dbh, $stmt);
while ($row = ibase_fetch_object ($sth)) {
print $row->email . "\n";
}
ibase_close ($dbh);
?>
</programlisting>
</informalexample>
</para>
<para>
See also <function>ibase_fetch_row</function>.
</para>
</refsect1>
</refentry>
<refentry id="function.ibase-field-info">
<refnamediv>
<refname>ibase_field_info</refname>
<refpurpose>
field관한 정보를 얻는다.
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>ibase_field_info</methodname>
<methodparam><type>int</type><parameter>result</parameter></methodparam>
<methodparam><type>int</type><parameter>field number</parameter></methodparam>
</methodsynopsis>
<para>
select쿼리의 실행후 필드의 정보를 배열로 리턴한다. 배열은 name, alias, relation, length, type이다.
<informalexample>
<programlisting role="php">
// helio@helio.com.br 08-Dec-2000 02:53
$rs=ibase_query("Select * from something");
$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";
}
</programlisting>
</informalexample>
</para>
</refsect1>
</refentry>
<refentry id="function.ibase-free-result">
<refnamediv>
<refname>ibase_free_result</refname>
<refpurpose>result set을 해제한다.</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>ibase_free_result</methodname>
<methodparam><type>int</type><parameter>result_identifier</parameter></methodparam>
</methodsynopsis>
<simpara>
<function>ibase_query</function>에 의해 생성된 결과 셋을 해제한다.
</simpara>
</refsect1>
</refentry>
<refentry id="function.ibase-prepare">
<refnamediv>
<refname>ibase_prepare</refname>
<refpurpose>
Prepare a query for later binding of parameter placeholders and
execution
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>ibase_prepare</methodname>
<methodparam choice="opt"><type>int</type><parameter>
link_identifier
</parameter></methodparam>
<methodparam><type>string</type><parameter>query</parameter></methodparam>
</methodsynopsis>
<simpara>
Prepare a query for later binding of parameter placeholders and
execution (via <function>ibase_execute</function>).
</simpara>
</refsect1>
</refentry>
<refentry id="function.ibase-execute">
<refnamediv>
<refname>ibase_execute</refname>
<refpurpose>이전에 준비된 query를 실행한다.</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>ibase_execute</methodname>
<methodparam><type>int</type><parameter>query</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>
bind_args
</parameter></methodparam>
</methodsynopsis>
<para>
<function>ibase_prepare</function>함수에 의해 준비된 쿼리를 실행한다.
만일 몇몇의 인자가 바뀌는 같은 쿼리문을 반복해서 실행할때, 이 함수는 <function>ibase_query</function>보다 유용하다.
<informalexample>
<programlisting role="php">
<?php
$updates = array(
1 => 'Eric',
5 => 'Filip',
7 => 'Larry'
);
$query = ibase_prepare("UPDATE FOO SET BAR = ? WHERE BAZ = ?");
while (list($baz, $bar) = each($updates)) {
ibase_execute($query, $bar, $baz);
}
?>
</programlisting>
</informalexample>
</para>
</refsect1>
</refentry>
<refentry id="function.ibase-trans">
<refnamediv>
<refname>ibase_trans</refname>
<refpurpose>transaction을 시작한다.</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>ibase_trans</methodname>
<methodparam choice="opt"><type>int</type><parameter>
trans_args
</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>
link_identifier
</parameter></methodparam>
</methodsynopsis>
<para>
transaction을 시작.
</para>
</refsect1>
</refentry>
<refentry id="function.ibase-commit">
<refnamediv>
<refname>ibase_commit</refname>
<refpurpose>transaction을 실행</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>ibase_commit</methodname>
<methodparam choice="opt"><type>int</type><parameter>
link_identifier
</parameter></methodparam>
<methodparam><type>int</type><parameter>trans_number</parameter></methodparam>
</methodsynopsis>
<para>
<function>ibase_trans</function>로 생성된 <parameter>trans_number</parameter>의 transaction을 실행
</para>
</refsect1>
</refentry>
<refentry id="function.ibase-rollback">
<refnamediv>
<refname>ibase_rollback</refname>
<refpurpose>transaction을 되돌린다.</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>ibase_rollback</methodname>
<methodparam choice="opt"><type>int</type><parameter>
link_identifier
</parameter></methodparam>
<methodparam><type>int</type><parameter>trans_number</parameter></methodparam>
</methodsynopsis>
<para>
<function>ibase_trans</function>에 의해 생성된 <parameter>trans_number</parameter>의 transaction을 되돌린다.
</para>
</refsect1>
</refentry>
<refentry id="function.ibase-free-query">
<refnamediv>
<refname>ibase_free_query</refname>
<refpurpose>
prepared query에 의해 지정된 메모리를 해제한다.
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>ibase_free_query</methodname>
<methodparam><type>int</type><parameter>query</parameter></methodparam>
</methodsynopsis>
<simpara>
<function>ibase_prepare</function>에의해 준비된 쿼리를 해제한다.
</simpara>
</refsect1>
</refentry>
<refentry id="function.ibase-timefmt">
<refnamediv>
<refname>ibase_timefmt</refname>
<refpurpose>
쿼리로 부터 리턴된 날짜와 시간타입의 포맷을 지정한다.
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>ibase_timefmt</methodname>
<methodparam><type>string</type><parameter>format</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>
columntype
</parameter></methodparam>
</methodsynopsis>
<para>
쿼리로 부터 리턴된 날짜와 시간타입의 포맷을 지정한다. 내부적으로, 컬럼은 c-function의 strftime()에 의한 포맷이어서,
그 문서는 문자 포멧으로 간주되어 제공된다.
<parameter>columntype</parameter>은 IBASE_TIMESTAMP에 포함된 것(IBASE_DATE and IBASE_TIME)들중 하나이다.
만약 생략된 경우, IBASE_TIMESTAMP의 기본 값은 backwards compatibility이다.
<informalexample>
<programlisting role="php">
<?php
// InterBase 6 TIME-type columns will be returned in
// the form '05 hours 37 minutes'.
ibase_timefmt("%H hours %M minutes", IBASE_TIME);
?>
</programlisting>
</informalexample>
</para>
<para>
이 기본값은 PHP 설정의 ibase.timestampformat(ibase.dateformat 와 ibase.timeformat)에서 지정할 수 있다.
</para>
<note>
<para>
<parameter>columntype</parameter>은 PHP 4.0에서 추가되었다. 이것은 InterBase version 6 또는 그 이상의 버젼에서 읨가 있다.
</para>
</note>
<note>
<para>
A backwards incompatible change happened in PHP 4.0 when PHP configuration directive ibase.timeformat was renamed to ibase.timestampformat and directives ibase.dateformat and ibase.timeformat were added, so that the names would match better their functionality
</para>
</note>
</refsect1>
</refentry>
<refentry id="function.ibase-num-fields">
<refnamediv>
<refname>ibase_num_fields</refname>
<refpurpose>
result set의 필드의 수를 얻는다.
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>ibase_num_fields</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
</methodsynopsis>
<para>
결가 셋의 필드의 수를 정수의 형으로 리턴한다.
<informalexample>
<programlisting role="php">
<?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");
}
ibase_close ($dbh);
?>
</programlisting>
</informalexample>
</para>
<para>
See also: <function>ibase_field_info</function>.
</para>
<note>
<para>
<function>ibase_num_fields</function>는 일반적으로 PHP 4에서 작동하지 않는다.
</para>
</note>
</refsect1>
</refentry>
<refentry id="function.ibase-errmsg">
<refnamediv>
<refname>ibase_errmsg</refname>
<refpurpose>
error messages를 반환
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>ibase_errmsg</methodname>
<methodparam><type>void</type><parameter/></methodparam>
</methodsynopsis>
<simpara>
error message를 포함한 문자를 반환한다.
</simpara>
</refsect1>
</refentry>
</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->
|