cvs: phpdoc-pl /reference/pgsql/functions pg-field-prtlen.xml pg-last-oid.xml

From: Date: Tue, 06 May 2008 19:37:53 +0000
Subject: cvs: phpdoc-pl /reference/pgsql/functions pg-field-prtlen.xml pg-last-oid.xml
Groups: php.doc.pl 
Request: Send a blank email to doc-pl+get-1372@lists.php.net to get a copy of this message
adi Tue May 6 19:37:53 2008 UTC Modified files: /phpdoc-pl/reference/pgsql/functions pg-field-prtlen.xml pg-last-oid.xml Log: update

http://cvs.php.net/viewvc.cgi/phpdoc-pl/reference/pgsql/functions/pg-field-prtlen.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc-pl/reference/pgsql/functions/pg-field-prtlen.xml diff -u phpdoc-pl/reference/pgsql/functions/pg-field-prtlen.xml:1.4 phpdoc-pl/reference/pgsql/functions/pg-field-prtlen.xml:1.5 --- phpdoc-pl/reference/pgsql/functions/pg-field-prtlen.xml:1.4 Sat Jun 23 13:29:34 2007 +++ phpdoc-pl/reference/pgsql/functions/pg-field-prtlen.xml Tue May 6 19:37:53 2008 @@ -1,55 +1,159 @@ -<?xml version="1.0" encoding="iso-8859-2"?> -<!-- EN-Revision: 1.2 Maintainer: jarek Status: ready --> -<!-- $Revision: 1.4 $--> -<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 --> - <refentry xml:id="function.pg-field-prtlen" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>pg_field_prtlen</refname> - <refpurpose>Zwraca drukowaln± d³ugo¶æ</refpurpose> - </refnamediv> - <refsect1> - <title>Opis</title> - <methodsynopsis> - <type>int</type><methodname>pg_field_prtlen</methodname> - <methodparam><type>resource</type><parameter>result</parameter></methodparam> - <methodparam><type>int</type><parameter>row_number</parameter></methodparam> - <methodparam><type>string</type><parameter>field_name</parameter></methodparam> - </methodsynopsis> - <para> - <function>pg_field_prtlen</function> zwraca aktualn± drukowaln± - d³ugo¶æ (liczbê znaków) wskazanej danej wyniku <parameter>result</parameter> - PostgreSQL-a. Wiersze s± numerowane od 0. Funkcja zwraca -1 w razie b³êdu. - </para> - <note> - <para> - Ta funkcja by³a poprzednio nazwana <literal>pg_fieldprtlen()</literal>. - <!-- Od t³umacza: w oryginale podana jest poprzednia nazwa funkcji: pg_field_prtlen - co jest oczywistym b³êdem. 2002-05-19, Jaros³aw Tabor, jarek@srv.pl --> - </para> - </note> - <para> - Zobacz tak¿e <function>pg_field_size</function>. - </para> - </refsect1> - </refentry> - -<!-- 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: -vim600: syn=xml fen fdm=syntax fdl=2 si -vim: et tw=78 syn=sgml -vi: ts=1 sw=1 ---> +<?xml version="1.0" encoding="iso-8859-2"?> +<!-- EN-Revision: 1.12 Maintainer: garbus Status: ready --> +<!-- $Revision: 1.5 $--> +<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 --> +<!-- CREDITS: jarek --> +<refentry xml:id="function.pg-field-prtlen" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>pg_field_prtlen</refname> + <refpurpose>Zwraca drukowaln± d³ugo¶æ</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>int</type><methodname>pg_field_prtlen</methodname> + <methodparam><type>resource</type><parameter>wynik</parameter></methodparam> + <methodparam><type>int</type><parameter>numer_wiersza</parameter></methodparam> + <methodparam><type>string</type><parameter>nazwa_pola_lub_numer</parameter></methodparam> + </methodsynopsis> + <methodsynopsis> + <type>int</type><methodname>pg_field_prtlen</methodname> + <methodparam><type>resource</type><parameter>wynik</parameter></methodparam> + <methodparam><type>mixed</type><parameter>nazwa_pola_lub_numer</parameter></methodparam> + </methodsynopsis> + <para> + <function>pg_field_prtlen</function> zwraca aktualn± drukowaln± + d³ugo¶æ (liczbê znaków) wskazanej danej wyniku parametru + <parameter>wynik</parameter> PostgreSQL-a. Wiersze s± numerowane od zera. Funkcja + zwraca -1 w razie b³êdu. + </para> + <para> + Parametr <parameter>nazwa_pola_lub_numer</parameter> przyjmie warto¶ci zarówno liczbowe + (<type>integer</type>), jak równie¿ ³añcuchowe (ang. <type>string</type>). Je¶li podano liczbê ca³kowit± + (<type>integer</type>), PHP rozpozna to jako numer pola, w przeciwnym wypadku jako + nazwê pola. + </para> + <para> + Proszê spojrzeæ na przyk³ad zawarty na stronie opisuj±cej funkcjê <function>pg_field_name</function>. + </para> + <note> + <para> + Ta funkcja by³a poprzednio nazwana <function>pg_fieldprtlen</function>. + </para> + </note> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>wynik</parameter></term> + <listitem> + <para> + Identyfikator wyniku zapytania do PostgreSQL, zwrócony przez <function>pg_guery</function>, + <function>pg_query_params</function> lub <function>pg_execute</function> + (miêdzy innymi). + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>wiersz</parameter></term> + <listitem> + <para> + Numer wiersza w wyniku. Wiersze s± numerowane od zera w górê. Je¶li pominiêto, + pobierany jest aktualny wiersz. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + D³ugo¶æ drukowailna pola, lub &false; w przypadku b³êdu. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Pobieranie informacji na temat pól</title> + <programlisting role="php"> +<![CDATA[ +<?php + $polaczenie_z_baza = pg_connect("dbname=wydawca") or die("Nie mo¿na siê po³±czyæ."); + + $wyn = pg_query($polaczenie_z_baza, "select * from autorzy where autor = 'Orwell'"); + $i = pg_num_fields($wyn); + for ($j = 0; $j < $i; $j++) { + echo "kolumna $j\n"; + $nazwa_pola = pg_field_name($wyn, $j); + echo "nazwa pola: $nazwa_pola\n"; + echo "d³ugo¶æ drukowalna: " . pg_field_prtlen($wyn, $nazwa_pola) . " znaki(ów)\n"; + echo "realna d³ugo¶æ: " . pg_field_size($wyn, $j) . " bajty(ów)\n"; + echo "typ pola: " . pg_field_type($wyn, $j) . " \n\n"; + } +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +kolumna 0 +nazwa pola: autor +d³ugo¶æ drukowalna: 6 znaki(ów) +realna d³ugo¶æ: -1 bajt(ów) +typ pola: varchar + +kolumna 1 +nazwa pola: rok +d³ugo¶æ drukowalna: 4 znaki(ów) +realna d³ugo¶æ: 2 bajt(ów) +typ pola: int2 + +kolumna 2 +nazwa pola: tytu³ +d³ugo¶æ drukowalna: 24 znaki(ów) +realna d³ugo¶æ: -1 bajt(ów) +typ pola: varchar +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>pg_field_size</function></member> + </simplelist> + </para> + </refsect1> +</refentry> + +<!-- 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: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 +--> http://cvs.php.net/viewvc.cgi/phpdoc-pl/reference/pgsql/functions/pg-last-oid.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc-pl/reference/pgsql/functions/pg-last-oid.xml diff -u phpdoc-pl/reference/pgsql/functions/pg-last-oid.xml:1.4 phpdoc-pl/reference/pgsql/functions/pg-last-oid.xml:1.5 --- phpdoc-pl/reference/pgsql/functions/pg-last-oid.xml:1.4 Sat Jun 23 13:29:34 2007 +++ phpdoc-pl/reference/pgsql/functions/pg-last-oid.xml Tue May 6 19:37:53 2008 @@ -1,60 +1,127 @@ -<?xml version="1.0" encoding="iso-8859-2"?> -<!-- EN-Revision: 1.3 Maintainer: jarek Status: ready --> -<!-- $Revision: 1.4 $--> -<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.82 --> - <refentry xml:id="function.pg-last-oid" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>pg_last_oid</refname> - <refpurpose>Zwraca identyfikator ostatniego obiektu</refpurpose> - </refnamediv> - <refsect1> - <title>Opis</title> - <methodsynopsis> - <type>int</type><methodname>pg_last_oid</methodname> - <methodparam><type>resource</type><parameter>result</parameter></methodparam> - </methodsynopsis> - <para> - <function>pg_last_oid</function> s³u¿y do pobrania <varname>oid</varname> - przypisanego do dopisanego wiersza, je¶li identyfikator wyniku pochodzi - z wywo³ania <function>pg_query</function> z poleceniem SQL INSERT. - Ta funkcja zwraca dodatni± liczbê je¶li uda³o siê pobraæ <varname>oid</varname> - i &false; w razie b³êdu lub je¶li ostatnim zapytaniem wys³anym przez - <function>pg_query</function> nie by³ INSERT, lub INSERT siê nie powiód³. - </para> - <para> - OID jest polem opcjonalnym od wersji PostgreSQL 7.2. Je¶li OID nie - by³ zdefiniowany w tabeli, programista musi u¿yæ <function>pg_result_status</function> - aby sprawdziæ czy rekord zosta³ dopisany czy nie. - </para> - <note> - <para> - Ta funkcja by³a poprzednio nazwana <literal>pg_getlastoid()</literal>. - </para> - </note> - <para> - Zobacz tak¿e <function>pg_query</function> i - <function>pg_result_status</function> - </para> - </refsect1> - </refentry> - -<!-- 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: -vim600: syn=xml fen fdm=syntax fdl=2 si -vim: et tw=78 syn=sgml -vi: ts=1 sw=1 ---> +<?xml version="1.0" encoding="iso-8859-2"?> +<!-- EN-Revision: 1.13 Maintainer: garbus Status: ready --> +<!-- $Revision: 1.5 $--> +<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.82 --> +<!-- CREDITS: jarek --> +<refentry xml:id="function.pg-last-oid" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>pg_last_oid</refname> + <refpurpose>Zwraca identyfikator OID ostatniego wiersza</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type><methodname>pg_last_oid</methodname> + <methodparam><type>resource</type><parameter>wynik</parameter></methodparam> + </methodsynopsis> + <para> + <function>pg_last_oid</function> s³u¿y do pobrania <varname>OID</varname> + przypisanego do dopisanego wiersza. + </para> + <para> + OID jest polem opcjonalnym od wersji PostgreSQL 7.2 i nie pojawi + siê domy¶lnie w PostgreSQL 8.1. Gdy + pole OID nie pojawia siê w tabeli, programista musi u¿yæ + <function>pg_result_status</function> aby sprawdziæ czy rekord zosta³ + dopisany czy nie. + </para> + <para> + Aby pobraæ warto¶æ pola <literal>SERIAL</literal> we wstawionym + wierszu, niezbêdnym jest u¿ycie funkcji PostgreSQL <literal>CURRVAL</literal>, + przekazuj±c sekwencjê, której wymagana jest ostatnia warto¶æ. Je¶li + nazwa sekwencji nie jest znana, konieczne jest u¿ycie funkcji <literal>pg_get_serial_sequence</literal> + PostgreSQL-a 8.0. + </para> + <para> + PostgreSQL 8.1 ma funkcjê <literal>LASTVAL</literal>, która zwraca + warto¶æ ostatnio u¿ytej sekwencji w sesji. To uchyla + potrzebê powo³ywania razem sekwencji, tabeli lub kolumny. + </para> + <note> + <para> + Ta funkcja by³a poprzednio nazwana <function>pg_getlastoid</function>. + </para> + </note> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>wynik</parameter></term> + <listitem> + <para> + Identyfikator wyniku zapytania PostgreSQL-a, zwrócony przez <function>pg_query</function>, + <function>pg_query_params</function> lub <function>pg_execute</function> + (miêdzy innymi). + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + £añcuch (ang. <type>string</type>) zawieraj±cy OID przydzielony do ostatnio wstawionego + wiersza w okre¶lonym parametrem <parameter>polaczenie</parameter> po³±czeniem, lub &false; w przypadku b³êdu lub + gdy OID nie jest dostêpny. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>pg_last_oid</function> - przyk³ad</title> + <programlisting role="php"> +<![CDATA[ +<?php + $pgsql_polaczenie = pg_connect("dbname=ocena host=localhost"); + + $wyn1 = pg_query("CREATE TABLE test (a INTEGER) WITH OIDS"); + + $wyn2 = pg_query("INSERT INTO test VALUES (1)"); + + $oid = pg_last_oid($wyn2); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>pg_query</function></member> + <member><function>pg_result_status</function></member> + </simplelist> + </para> + </refsect1> +</refentry> + +<!-- 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: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 +-->
« previous php.doc.pl (#1372) next »