cvs: phpdoc-cs /reference/mysql functions.xml reference.xml /reference/mysql/functions mysql-unbuffered-query.xml

From: Date: Wed, 05 Jun 2002 20:42:03 +0000
Subject: cvs: phpdoc-cs /reference/mysql functions.xml reference.xml /reference/mysql/functions mysql-unbuffered-query.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969346220@lists.php.net to get a copy of this message
costra Wed Jun 5 16:42:03 2002 EDT Modified files: /phpdoc-cs/reference/mysql functions.xml reference.xml /phpdoc-cs/reference/mysql/functions mysql-unbuffered-query.xml Log: Updated files Modified Files: cs/reference/mysql/reference.xml from en rev. 1.5 cs/reference/mysql/functions/mysql-unbuffered-query.xml from en rev. 1.3 Added Files: cs/reference/mysql/functions.xml from en rev. 1.1

Index: phpdoc-cs/reference/mysql/functions.xml diff -u /dev/null phpdoc-cs/reference/mysql/functions.xml:1.3 --- /dev/null Wed Jun 5 16:42:03 2002 +++ phpdoc-cs/reference/mysql/functions.xml Wed Jun 5 16:42:03 2002 @@ -0,0 +1,48 @@ +&reference.mysql.functions.mysql-affected-rows; +&reference.mysql.functions.mysql-change-user; +&reference.mysql.functions.mysql-character-set-name; +&reference.mysql.functions.mysql-close; +&reference.mysql.functions.mysql-connect; +&reference.mysql.functions.mysql-create-db; +&reference.mysql.functions.mysql-data-seek; +&reference.mysql.functions.mysql-db-name; +&reference.mysql.functions.mysql-db-query; +&reference.mysql.functions.mysql-drop-db; +&reference.mysql.functions.mysql-errno; +&reference.mysql.functions.mysql-error; +&reference.mysql.functions.mysql-escape-string; +&reference.mysql.functions.mysql-fetch-array; +&reference.mysql.functions.mysql-fetch-assoc; +&reference.mysql.functions.mysql-fetch-field; +&reference.mysql.functions.mysql-fetch-lengths; +&reference.mysql.functions.mysql-fetch-object; +&reference.mysql.functions.mysql-fetch-row; +&reference.mysql.functions.mysql-field-flags; +&reference.mysql.functions.mysql-field-len; +&reference.mysql.functions.mysql-field-name; +&reference.mysql.functions.mysql-field-seek; +&reference.mysql.functions.mysql-field-table; +&reference.mysql.functions.mysql-field-type; +&reference.mysql.functions.mysql-free-result; +&reference.mysql.functions.mysql-get-client-info; +&reference.mysql.functions.mysql-get-host-info; +&reference.mysql.functions.mysql-get-proto-info; +&reference.mysql.functions.mysql-get-server-info; +&reference.mysql.functions.mysql-info; +&reference.mysql.functions.mysql-insert-id; +&reference.mysql.functions.mysql-list-dbs; +&reference.mysql.functions.mysql-list-fields; +&reference.mysql.functions.mysql-list-processes; +&reference.mysql.functions.mysql-list-tables; +&reference.mysql.functions.mysql-num-fields; +&reference.mysql.functions.mysql-num-rows; +&reference.mysql.functions.mysql-pconnect; +&reference.mysql.functions.mysql-ping; +&reference.mysql.functions.mysql-query; +&reference.mysql.functions.mysql-real-escape-string; +&reference.mysql.functions.mysql-result; +&reference.mysql.functions.mysql-select-db; +&reference.mysql.functions.mysql-stat; +&reference.mysql.functions.mysql-tablename; +&reference.mysql.functions.mysql-thread-id; +&reference.mysql.functions.mysql-unbuffered-query; Index: phpdoc-cs/reference/mysql/reference.xml diff -u phpdoc-cs/reference/mysql/reference.xml:1.2 phpdoc-cs/reference/mysql/reference.xml:1.3 --- phpdoc-cs/reference/mysql/reference.xml:1.2 Mon Apr 15 18:06:05 2002 +++ phpdoc-cs/reference/mysql/reference.xml Wed Jun 5 16:42:03 2002 @@ -4,7 +4,27 @@ <title>MySQL Funkce</title> <titleabbrev>MySQL</titleabbrev> <partintro> - <simpara> + <para id="mysql.intro"> + Tyto funkce zprostøedkovávají pøístup na MySQL databázový server. + Více informací o MySQL lze nalézt na <ulink + url="&url.mysql;">&url.mysql;</ulink>. + </para> + <para> + Dokumentace k MySQL je dostupná na <ulink + url="&url.mysql.docs;">&url.mysql.docs;</ulink>. + </para> + + <section id="mysql.requirements"> + <title>Po¾adavky</title> + <para> + Aby byly tyto funkce dostupné, musí být PHP zkompilováno s podporou +MySQL. + </para> + </section> + + <section id="mysql.installation"> + <title>Instalace</title> + <para> Tyto funkce zprostøedkovávají pøístup na MySQL databázový server. Mají-li být tyto funkce dostupné, musí být PHP zkompilováno s podporou MySQL parametrem <option role="configure">--with-mysql</option>. @@ -17,71 +37,301 @@ <option role="configure">--with-mysql=/cesta/k/mysql</option>. PHP tak pou¾ije klientské knihovny instalované MySQL, èím¾ se vyvarujete mo¾ných konfliktùm. - </simpara> - <simpara> - Více informací o MySQL naleznete na <ulink - url="&url.mysql;">&url.mysql;</ulink>. - </simpara> - <simpara> - Dokumentace k MySQL je na <ulink - url="&url.mysql.docs;">&url.mysql.docs;</ulink>. - </simpara> + </para> + </section> + + <section id="mysql.configuration"> + <title>Runtime konfigurace</title> <para> Chování funkcí MySQL je ovlivnìno nastavením v globálním - <link linkend="configuration">konfihuraèním</link> souboru. - <table> - <title><link linkend="ini.sect.mysql">Konfigurace MySQL</link> - Volby</title> - <tgroup cols="3"> - <thead> - <row> - <entry>Jméno</entry> - <entry>Výchozí</entry> - <entry>Zmìnitelné</entry> - </row> - </thead> - <tbody> - <row> - <entry>mysql.allow_persistent</entry> - <entry>"On"</entry> - <entry>PHP_INI_SYSTEM</entry> - </row> - <row> - <entry>mysql.max_persistent</entry> - <entry>"-1"</entry> - <entry>PHP_INI_SYSTEM</entry> - </row> - <row> - <entry>mysql.max_links</entry> - <entry>"-1"</entry> - <entry>PHP_INI_SYSTEM</entry> - </row> - <row> - <entry>mysql.default_port</entry> - <entry>NULL</entry> - <entry>PHP_INI_ALL</entry> - </row> - <row> - <entry>mysql.default_socket</entry> - <entry>NULL</entry> - <entry>PHP_INI_ALL</entry> - </row> - <row> - <entry>mysql.default_host</entry> - <entry>NULL</entry> - <entry>PHP_INI_ALL</entry> - </row> - <row> - <entry>mysql.default_user</entry> - <entry>NULL</entry> - <entry>PHP_INI_ALL</entry> - </row> - </tbody> - </tgroup> - </table> + <link linkend="configuration.file">konfiguraèním souboru</link> &php.ini;. + <table> + <title>Mo¾nosti nastavení MySQL</title> + <tgroup cols="3"> + <thead> + <row> + <entry>Jméno</entry> + <entry>Výchozí</entry> + <entry>Zmìnitelné</entry> + </row> + </thead> + <tbody> + <row> + <entry>mysql.allow_persistent</entry> + <entry>"On"</entry> + <entry>PHP_INI_SYSTEM</entry> + </row> + <row> + <entry>mysql.max_persistent</entry> + <entry>"-1"</entry> + <entry>PHP_INI_SYSTEM</entry> + </row> + <row> + <entry>mysql.max_links</entry> + <entry>"-1"</entry> + <entry>PHP_INI_SYSTEM</entry> + </row> + <row> + <entry>mysql.default_port</entry> + <entry>NULL</entry> + <entry>PHP_INI_ALL</entry> + </row> + <row> + <entry>mysql.default_socket</entry> + <entry>NULL</entry> + <entry>PHP_INI_ALL</entry> + </row> + <row> + <entry>mysql.default_host</entry> + <entry>NULL</entry> + <entry>PHP_INI_ALL</entry> + </row> + <row> + <entry>mysql.default_user</entry> + <entry>NULL</entry> + <entry>PHP_INI_ALL</entry> + </row> + <row> + <entry>mysql.default_password</entry> + <entry>NULL</entry> + <entry>PHP_INI_ALL</entry> + </row> + </tbody> + </tgroup> + </table> Podrobný popis a definice konstant PHP_INI_* naleznete v <function>ini_set</function>. </para> + <para> + Zde je krátké vysvìtlení konfiguraèních pøíkazù. + <variablelist> + + <varlistentry id="ini.mysql.allow-persistent"> + <term> + <parameter>mysql.allow_persistent</parameter> + <type>boolean</type> + </term> + <listitem> + <para> + Má-li být povoleno + <link linkend="features.persistent-connections">persistentní (trvalá) +spojení</link> s MySQL. + </para> + </listitem> + </varlistentry> + + <varlistentry id="ini.mysql.max-persistent"> + <term> + <parameter>mysql.max_persistent</parameter> + <type>integer</type> + </term> + <listitem> + <para> + Maximální poèet persistentních spojení na jeden proces. + </para> + </listitem> + </varlistentry> + + <varlistentry id="ini.mysql.max-links"> + <term> + <parameter>mysql.max_links</parameter> + <type>integer</type> + </term> + <listitem> + <para> + Maximální poèet spojení s MySQL na jeden proces vèetnì persistentních +spojení. + </para> + </listitem> + </varlistentry> + + <varlistentry id="ini.mysql.default-port"> + <term> + <parameter>mysql.default_port</parameter> + <type>string</type> + </term> + <listitem> + <para> + Èíslo výchozího TCP portu pro spojení s databázovým serverem, pokud není +port zadán. Není-li výchozí port zadán, pou¾ije se port uvedený v promìnné +prostøedí <literal>MYSQL_TCP_PORT</literal>., záznam +<literal>mysql-tcp</literal> v <filename>/etc/services</filename> +nebo &quot;compile-time&quot; konstanta <literal>MYSQL_PORT</literal>, v tomto +poøadí. Win32 pou¾ívá pouze konstantu <literal>MYSQL_PORT</literal>. +</para> </listitem> +</varlistentry> + + <varlistentry id="ini.mysql.default-socket"> + <term> + <parameter>mysql.default_socket</parameter> + <type>string</type> + </term> + <listitem> + <para> + Výchozí jméno socketu pro pøipojení k lokálnímu databázovému serveru, +není-li jiný socket specifikován. </para> + </listitem> + </varlistentry> + + <varlistentry id="ini.mysql.default-host"> + <term> + <parameter>mysql.default_host</parameter> + <type>string</type> + </term> + <listitem> + <para> + Výchozí server pro spojení s databázovým serverem, není-li uveden jiný. + Nelze pou¾ít pøi <link linkend="ini.safe-mode">bezpeèném re¾imu (safe +mode)</link>. </para> + </listitem> + </varlistentry> + + <varlistentry id="ini.mysql.default-user"> + <term> + <parameter>mysql.default_user</parameter> + <type>string</type> + </term> + <listitem> + <para> + Výchozí u¾ivatel pro spojení s databázovým serverem, není-li uveden jiný +u¾ivatel. Nelze pou¾ít pøi <link linkend="ini.safe-mode">bezpeèném re¾imu (safe +mode)</link>. + </para> + </listitem> + </varlistentry> + + <varlistentry id="ini.mysql.default-password"> + <term> + <parameter>mysql.default_password</parameter> + <type>string</type> + </term> + <listitem> + <para> + Výchozí heslo pro spojení s databázovým serverem, není-li uveeno jiné +heslo. Nelze pou¾ít pøi <link linkend="ini.safe-mode">bezpeèném re¾imu (safe +mode)</link>. + </para> + </listitem> + </varlistentry> + + </variablelist> + </para> + </section> + + <section id="mysql.resources"> + <title>Typy zdrojù</title> + <para> + V modulu MySQL jsou pou¾ity dva typy zdrojù. První zdroj je +identifikátor databázového spojení a druhý, který vykonává výsledek dotazu..</para> + </section> + + <section id="mysql.constants"> + <title>Pøeddefinované konstanty</title> + <para> + Funkce <function>mysql_fetch_array</function> pou¾ívá konstanty pro +rùzné typy výsledkových polí. Jsou definovány následující konstanty: + <table> + <title>MySQL fetch konstanty</title> + <tgroup cols="2"> + <thead> + <row> + <entry>konstanta</entry> + <entry>popis</entry> + </row> + </thead> + <tbody> + <row> + <entry>MYSQL_ASSOC</entry> + <entry> + Sloupce jsou vraceny do pole jeho¾ klíèemi jsou názvy sloupcù. + </entry> + </row> + <row> + <entry>MYSQL_BOTH</entry> + <entry> + Sloupce jsou vráceny do pole majícího èíslené i textové +klíèe, urèující poøadí sloupce v tabulce, respektive jeho jméno.</entry> + </row> + <row> + <entry>MYSQL_NUM</entry> + <entry> + Vrací sloupec do pole s èíselnými klíèi reprezentujícími poøadí sloupce +v tabulce. První sloupec tabulky zaèíná klíèem 0.</entry> + </row> + <row> + <entry>MYSQL_STORE_RESULT</entry> + <entry> + Urèuje, zda by mìl být výsledek MySQL bufferován. + </entry> + </row> + <row> + <entry>MYSQL_USE_RESULT</entry> + <entry> + Urèuje, zda by výsledek MySQL nemìl být bufferován. + </entry> + </row> + </tbody> + </tgroup> + </table> + </para> + </section> + + <section id="mysql.examples"> + <para> + Zde je jednoduchý ukázkový pøíklad jak se pøipojit, provést dotaz, + zobrazit výsledné øádky a odpojit se z MySQL databáze. + <example> + <title>Ukázkový pøíklad pou¾ití MySQL</title> + <programlisting role="php"> +<![CDATA[ +<?php +// Pøipojení, výbìr databáze +$link = mysql_connect("mysql_host", "mysql_login", "mysql_heslo") + or die("Nelze se pøipojit"); +print "Pøipojeno úspì¹nì!"; +mysql_select_db("moje_databaze") + or die("Nelze vybrat databázi"); + +// Pøíprava SQL dotazu +$query = "SELECT * FROM moje_tabulka"; +$result = mysql_query($query) + or die("Dotaz nelze provést"); + +// Zobrazení výsledku v HTML +print "<table>\n"; +while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { + print "\t<tr>\n"; + foreach ($line as $col_value) { + print "\t\t<td>$col_value</td>\n"; + } + print "\t</tr>\n"; +} +print "</table>\n"; + +// Odpojení z MySQL databáze +mysql_close($link); +?> +]]> + </programlisting> + </example> + </para> + </section> + </partintro> + +&reference.mysql.functions; + + </reference> + + + + + + + + + + + <para> Toto je jednoduchý ukázkový pøíklad jak se pøipojit, provést dotaz, zobrazit výsledné øádky a odpojit se z MySQL databáze. Index: phpdoc-cs/reference/mysql/functions/mysql-unbuffered-query.xml diff -u phpdoc-cs/reference/mysql/functions/mysql-unbuffered-query.xml:1.2 phpdoc-cs/reference/mysql/functions/mysql-unbuffered-query.xml:1.3 --- phpdoc-cs/reference/mysql/functions/mysql-unbuffered-query.xml:1.2 Thu May 30 18:24:53 2002 +++ phpdoc-cs/reference/mysql/functions/mysql-unbuffered-query.xml Wed Jun 5 16:42:03 2002 @@ -19,7 +19,7 @@ <para> <function>mysql_unbuffered_query</function> po¹le SQL dotaz <parameter>dotaz</parameter> do MySQL bez naètení a bufferování výsledných -záznamù automaticky, jako to dìlá funce +záznamù automaticky, jako to dìlá funkce <function>mysql_query</function>. Na jednu stranu toto chování u¹etøí znaèné mno¾ství pou¾ité pamìti u SQL dotazù, které vytváøejí rozsáhlé výsledky. Na druhou stranu mù¾ete zaèít pracovat na výsledku okam¾itì po prvním záznamu,
« previous php.doc (#969346220) next »