mirror of
https://github.com/php/doc-pl.git
synced 2026-04-27 08:48:05 +02:00
ff4d6f033a
Ugh, I thought it's gonna be easier
159 lines
3.9 KiB
XML
159 lines
3.9 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!-- EN-Revision: c2eca73ef79ebe78cebb34053e41b565af504c4f Maintainer: garbus Status: ready -->
|
|
<!-- $Revision$-->
|
|
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
|
|
<!-- CREDITS: jarek -->
|
|
<refentry xml:id="function.pg-field-size" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>pg_field_size</refname>
|
|
<refpurpose>
|
|
Zwraca wewnętrzny rozmiar kolumny
|
|
</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>pg_field_size</methodname>
|
|
<methodparam><type>PgSql\Result</type><parameter>result</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>field</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>pg_field_size</function> zwraca wewnętrzny rozmiar
|
|
(w bajtach) wskazanej numerem kolumny w wyniku PostgreSQL-a
|
|
podanym jako <parameter>result</parameter>.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Ta funkcja była poprzednio nazwana <function>pg_fieldsize</function>.
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>result</parameter></term>
|
|
<listitem>
|
|
&pgsql.parameter.result;
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>field</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Numer pola, zaczynając od zera.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Wewnętrzny rozmiar danego pola (w bajtach). -1 oznacza niestałą
|
|
wielkość pola.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
&pgsql.changelog.result-object;
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Pobieranie informacji o polach</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$polaczenie = pg_connect("dbname=wydawca") or die("Nie można się połączyć");
|
|
|
|
$wyn = pg_query($polaczenie, "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 "drukowalna długość: " . pg_field_prtlen($wyn, $nazwa_pola) . " znak(ów)\n";
|
|
echo "rzeczywista długość: " . pg_field_size($wyn, $j) . " bajt(ów)\n";
|
|
echo "typ pola: " . pg_field_type($wyn, $j) . " \n\n";
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
kolumna 0
|
|
nazwa pola: autor
|
|
drukowalna długość: 6 znak(ów)
|
|
rzeczywista długość: -1 bajt(ów)
|
|
typ pola: varchar
|
|
|
|
kolumna 1
|
|
nazwa pola: rok
|
|
drukowalna długość: 4 znak(ów)
|
|
rzeczywista długość: 2 bajt(ów)
|
|
typ pola: int2
|
|
|
|
kolumna 2
|
|
nazwa pola: tytul
|
|
drukowalna długość: 24 znak(ów)
|
|
rzeczywista długość: -1 bajt(ów)
|
|
typ pola: varchar
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>pg_field_prtlen</function></member>
|
|
<member><function>pg_field_type</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:"~/.phpdoc/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
|
|
-->
|