cvs: phpdoc-ru /reference/sqlite constants.xml ini.xml reference.xml /reference/sqlite/functions sqlite-array-query.xml sqlite-busy-timeout.xml
sqlite-changes.xml sqlite-close.xml sqlite-column.xml sqlite-create-aggregate.xml sqlite-create-function.xml sqlite-current.xml
sqlite-error-string.xml sqlite-escape-string.xml sqlite-exec.xml sqlite-factory.xml sqlite-fetch-all.xml sqlite-fetch-array.xml
sqlite-fetch-column-types.xml sqlite-fetch-object.xml sqlite-fetch-single.xml sqlite-fetch-string.xml sqlite-field-name.xml sqlite-has-more.xml
sqlite-has-prev.xml sqlite-last-error.xml sqlite-last-insert-rowid.xml sqlite-libencoding.xml sqlite-libversion.xml sqlite-next.xml
sqlite-num-fields.xml sqlite-num-rows.xml sqlite-open.xml sqlite-popen.xml sqlite-prev.xml sqlite-query.xml sqlite-rewind.xml sqlite-seek.xml
sqlite-single-query.xml sqlite-udf-decode-binary.xml sqlite-udf-encode-binary.xml sqlite-unbuffered-query.xml

From: Date: Sat, 18 Dec 2004 12:06:47 +0000
Subject: cvs: phpdoc-ru /reference/sqlite constants.xml ini.xml reference.xml /reference/sqlite/functions sqlite-array-query.xml sqlite-busy-timeout.xml
sqlite-changes.xml sqlite-close.xml sqlite-column.xml sqlite-create-aggregate.xml sqlite-create-function.xml sqlite-current.xml
sqlite-error-string.xml sqlite-escape-string.xml sqlite-exec.xml sqlite-factory.xml sqlite-fetch-all.xml sqlite-fetch-array.xml
sqlite-fetch-column-types.xml sqlite-fetch-object.xml sqlite-fetch-single.xml sqlite-fetch-string.xml sqlite-field-name.xml sqlite-has-more.xml
sqlite-has-prev.xml sqlite-last-error.xml sqlite-last-insert-rowid.xml sqlite-libencoding.xml sqlite-libversion.xml sqlite-next.xml
sqlite-num-fields.xml sqlite-num-rows.xml sqlite-open.xml sqlite-popen.xml sqlite-prev.xml sqlite-query.xml sqlite-rewind.xml sqlite-seek.xml
sqlite-single-query.xml sqlite-udf-decode-binary.xml sqlite-udf-encode-binary.xml sqlite-unbuffered-query.xml
Groups: php.doc.ru 
Request: Send a blank email to doc-ru+get-528@lists.php.net to get a copy of this message
blindman Sat Dec 18 07:06:47 2004 EDT Added files: /phpdoc-ru/reference/sqlite constants.xml ini.xml reference.xml /phpdoc-ru/reference/sqlite/functions sqlite-array-query.xml sqlite-busy-timeout.xml sqlite-changes.xml sqlite-close.xml sqlite-column.xml sqlite-create-aggregate.xml sqlite-create-function.xml sqlite-current.xml sqlite-error-string.xml sqlite-escape-string.xml sqlite-exec.xml sqlite-factory.xml sqlite-fetch-all.xml sqlite-fetch-array.xml sqlite-fetch-column-types.xml sqlite-fetch-object.xml sqlite-fetch-single.xml sqlite-fetch-string.xml sqlite-field-name.xml sqlite-has-more.xml sqlite-has-prev.xml sqlite-last-error.xml sqlite-last-insert-rowid.xml sqlite-libencoding.xml sqlite-libversion.xml sqlite-next.xml sqlite-num-fields.xml sqlite-num-rows.xml sqlite-open.xml sqlite-popen.xml sqlite-prev.xml sqlite-query.xml sqlite-rewind.xml sqlite-seek.xml sqlite-single-query.xml sqlite-udf-decode-binary.xml sqlite-udf-encode-binary.xml sqlite-unbuffered-query.xml Log: add new translation

http://cvs.php.net/co.php/phpdoc-ru/reference/sqlite/constants.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/constants.xml +++ phpdoc-ru/reference/sqlite/constants.xml <?xml version='1.0' encoding='windows-1251'?> <!-- EN-Revision: 1.2 Maintainer: blindman Status: ready--> <!-- $Revision: 1.1 $ --> <section id="sqlite.constants"> &reftitle.constants; <para> Ôóíêöèè <function>sqlite_fetch_array</function> è <function>sqlite_current</function> ìîãóò ïðèíèìàòü àðãóìåíò, çàäàþùèé âèä âîçâðàùàåìîãî ìàññèâà.  êà÷åñòâå çíà÷åíèÿ ýòîãî àðãóìåíòà èñïîëüçóåòñÿ îäíà èç ñëåäóþùèõ êîíñòàíò: </para> <para> <table> <title>Êîíñòàíòû âûáîðêè SQLite</title> <tgroup cols="2"> <thead> <row> <entry>Êîíñòàíòà</entry> <entry>Çíà÷åíèå</entry> </row> </thead> <tbody> <row> <entry>SQLITE_ASSOC</entry> <entry> Èíäåêñàìè ìàññèâà ÿâëÿþòñÿ èìåíà ïîëåé. </entry> </row> <row> <entry>SQLITE_BOTH</entry> <entry> Êàæäîìó ïîëþ ñîîòâåòñòâóþò äâà ýëåìåíòà ìàññèâà: ñ ÷èñëîâûì èíäåêñîì, ÿâëÿþùèìñÿ ïîðÿäêîâûì íîìåðîì ïîëÿ, íà÷èíàÿ ñ 0, è ñòðîêîâûì èíäåêñîì - èìåíåì ïîëÿ. </entry> </row> <row> <entry>SQLITE_NUM</entry> <entry> Èíäåêñàìè ìàññèâà ÿâëÿþòñÿ ïîðÿäêîâûå íîìåðà ïîëåé, íà÷èíàÿ ñ 0. </entry> </row> </tbody> </tgroup> </table> </para> </section> <!-- 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/co.php/phpdoc-ru/reference/sqlite/ini.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/ini.xml +++ phpdoc-ru/reference/sqlite/ini.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.6 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <section id="sqlite.configuration"> &reftitle.runtime; &extension.runtime; <para> <table> <title>Äèðåêòèâû êîíôèãóðàöèè SQLite</title> <tgroup cols="3"> <thead> <row> <entry>Èìÿ</entry> <entry>Çíà÷åíèå ïî óìîë÷àíèþ</entry> <entry>Èçìåíÿåòñÿ</entry> </row> </thead> <tbody> <row> <entry>sqlite.assoc_case</entry> <entry>0</entry> <entry>PHP_INI_ALL</entry> </row> </tbody> </tgroup> </table> Ïîäðîáíîå îïèñàíèå êîíñòàíò PHP_INI_* ñì. â îïèñàíèè ôóíêöèè <function>ini_set</function>. </para> &ini.descriptions.title; <para> <variablelist> <varlistentry id="ini.sqlite.assoc-case"> <term> <parameter>sqlite.assoc_case</parameter> <type>int</type> </term> <listitem> <para> Èñïîëüçîâàíèå ñìåøàííîãî (<literal>0</literal>), âåðõíåãî (<literal>1</literal>) èëè íèæíåãî (<literal>2</literal>) ðåãèñòðà ñèìâîëîâ â èìåíàõ ïîëåé. </para> <para> Ýòà äèðåêòèâà èñïîëüçóåòñÿ â îñíîâíîì äëÿ îáåñïå÷åíèÿ ñîâìåñòèìîñòè ñ ñèñòåìàìè óïðàâëåíèÿ áàçàìè äàííûõ, â êîòîðûõ èìåíà ïîëåé âñåãäà âîçâðàùàþòñÿ â âåðõíåì èëè íèæíåì ðåãèñòðå, íåçàâèñèìî îò ðåãèñòðà ñèìâîëîâ, çàäàííîãî â ñòðóêòóðå áàçû äàííûõ. </para> <para> Áèáëèîòåêà SQLite âîçâðàùàåò èìåíà ïîëåé â òî÷íîñòè òàê, êàê îíè çàäàíû â ñòðóêòóðå áàçû äàííûõ. Åñëè äèðåêòèâà <parameter>sqlite.assoc_case</parameter> èìååò çíà÷åíèå <literal>0</literal>, ðåãèñòð ñèìâîëîâ îñòàåòñÿ áåç èçìåíåíèÿ. Êîãäà îíà èìååò çíà÷åíèå <literal>1</literal> èëè <literal>2</literal>, PHP ïðåîáðàçóåò èìåíà ïîëåé â âåðõíèé èëè íèæíèé ðåãèñòð ñîîòâåòñòâåííî. </para> <para> Èñïîëüçîâàíèå ýòîé äèðåêòèâû íåìíîãî ñíèæàåò ïðîèçâîäèòåëüíîñòü, îäíàêî ýòî ÍÀÌÍÎÃÎ áûñòðåå, ÷åì ïðåîáðàçîâàíèå ðåãèñòðà â PHP ñêðèïòå. </para> </listitem> </varlistentry> </variablelist> </para> </section> <!-- 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/co.php/phpdoc-ru/reference/sqlite/reference.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/reference.xml +++ phpdoc-ru/reference/sqlite/reference.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.10 Maintainer:blindman Status: ready --> <!-- $Revision: 1.1 $ --> <reference id="ref.sqlite"> <title>SQLite</title> <titleabbrev>SQLite</titleabbrev> <partintro> <section id="sqlite.intro"> &reftitle.intro; <para> Ýòîò ìîäóëü îáåñïå÷èâàåò äîñòóï ê âñòðàèâàåìîé ñèñòåìå óïðàâëåíèÿ áàçàìè äàííûõ SQLite. Ïðîãðàììû, èñïîëüçóþùèå áèáëèîòåêó SQLite, ìîãóò èñïîëüçîâàòü SQL áàçû äàííûõ áåç èñïîëüçîâàíèÿ âíåøíåé ñèñòåìû óïðàâëåíèÿ áàçàìè äàííûõ. </para> <para> SQLite íå ÿâëÿåòñÿ êëèåíòñêîé áèáëèîòåêîé, ïîäêëþ÷àþùåéñÿ ê ñåðâåðó áàçû äàííûõ. SQLite íàïðÿìóþ ðàáîòàåò ñ ôàéëàìè áàçû äàííûõ íà äèñêå. </para> <note> <para> Áîëåå ïîäðîáíóþ èíôîðìàöèþ ìîæíî ïîëó÷èòü íà ñàéòå SQLite (<ulink url="&url.sqlite;">&url.sqlite;</ulink>). </para> </note> </section> <section id="sqlite.install"> <title>Óñòàíîâêà</title> <para> Ïðî÷òèòå ôàéë INSTALL, ïîñòàâëÿåìûé ñ èñõîäíûìè òåñòàìè ìîäóëÿ. Èëè ïðîñòî âîñïîëüçóéòåñü êîìàíäîé óñòàíîâêè PEAR: "pear install sqlite". Áèáëèîòåêà SQLite âêëþ÷åíà, óñòàíàâëèâàòü åå äîïîëíèòåëüíî íåò íåîáõîäèìîñòè. </para> <para> Ïîëüçîâàòåëè Windows ìîãóò çàãðóçèòü ñêîìïèëèðîâàííóþ âåðñèþ ìîäóëÿ SQLite çäåñü: (<ulink url="&url.pecl.get.win;php_sqlite.dll">php_sqlite.dll</ulink>). </para> <para>  PHP 5, ìîäóëü SQLite âêëþ÷åí è óñòàíàâëèâàåòñÿ ïî óìîë÷àíèþ. </para> </section> <section id="sqlite.requirements"> &reftitle.required; <para> Äëÿ èñïîëüçîâàíèÿ ôóíêöèé ýòîãî ìîäóëÿ, PHP äîëæåí áûòü ñîáðàí ñ ïîääåðæêîé SQLite, èëè ìîäóëü äîëæí áûòü ïîäêëþ÷åí äèíàìè÷åñêè â &php.ini;. </para> </section> <section id="sqlite.resources"> &reftitle.resources; <para> Ìîäóëü SQLite îïðåäåëÿåò äâà òèïà ðåñóðñîâ : ñîåäèíåíèå ñ áàçîé äàííûõ è ðåçóëüòàò çàïðîñà. </para> </section> &reference.sqlite.constants; &reference.sqlite.ini; </partintro> &reference.sqlite.functions; </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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-array-query.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-array-query.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-array-query.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.8 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-array-query"> <refnamediv> <refname>sqlite_array_query</refname> <refpurpose> Âûïîëíÿåò çàïðîñ ê áàçå äàííûõ è âîçâðàùàåò ðåçóëüòàò â âèäå ìàññèâà </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>array</type><methodname>sqlite_array_query</methodname> <methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam> <methodparam><type>string</type><parameter>query</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam> </methodsynopsis> <methodsynopsis> <type>array</type><methodname>sqlite_array_query</methodname> <methodparam><type>string</type><parameter>query</parameter></methodparam> <methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam> </methodsynopsis> <para> Èñïîëüçîâàíèå <function>sqlite_array_query</function> èäåíòè÷íî èñïîëüçîâàíèþ <function>sqlite_query</function> ñ ïîñëåäóþùèì âûçîâîì <function>sqlite_fetch_array</function> äëÿ êàæäîé çàïèñè ðåçóëüòàòà çàïðîñà ñ ñîõðàíåíèåì çàïèñåé â ìàññèâå, êàê ïîêàçàíî â ïðèâåäåííîì íèæå ïðèìåðå. <function>sqlite_array_query</function> âûïîëíÿåòñÿ çíà÷èòåëüíî áûñòðåå, ÷åì òàêîé ñêðèïò. </para> <example> <title>Ñàìîñòîÿòåëüíàÿ ðåàëèçàöèÿ <function>sqlite_array_query</function></title> <programlisting role="php"> <![CDATA[ <?php $q = sqlite_query($dbhandle, "SELECT * from foo LIMIT 100"); $rows = array(); while ($r = sqlite_fetch_array($q)) { $rows[] = $r; } ?> ]]> </programlisting> </example> <tip> <para> <function>sqlite_array_query</function> íàèëó÷øèì îáðàçîì ïîäõîäèò äëÿ çàïðîñîâ, âîçâðàùàþùèõ äî 45 çàïèñåé. Äëÿ çàïðîñîâ, âîçâðàùàþùèõ áîëüøèå íàáîðû çàïèñåé, îïòèìàëüíûì ñ òî÷êè çðåíèÿ áûñòðîäåéñòâèÿ ÿâëÿåòñÿ èñïîëüçîâàíèå ôóíêöèè <function>sqlite_unbuffered_query</function>. </para> </tip> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_query</function>, <function>sqlite_fetch_array</function> è <function>sqlite_fetch_string</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-busy-timeout.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-busy-timeout.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-busy-timeout.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.5 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-busy-timeout"> <refnamediv><refname>sqlite_busy_timeout</refname> <refpurpose>Óñòàíàâëèâàåò âðåìÿ îæèäàíèÿ</refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>void</type><methodname>sqlite_busy_timeout</methodname> <methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam> <methodparam><type>int</type><parameter>milliseconds</parameter></methodparam> </methodsynopsis> <para> Óñòàíàâëèâàåò ìàêñèìàëüíîå âðåìÿ, â òå÷åíèå êîòîðîãî sqlite îæèäàåò ãîòîâíîñòè áàçû äàííûõ, çàäàííîé àðãóìåíòîì <parameter>dbhandle</parameter>, â <parameter>milliseconds</parameter> ìèëëèñåêóíä. Åñëè <parameter>milliseconds</parameter> ðàâåí <literal>0</literal>, òî â ñëó÷àå, êîãäà ôàéë áàçû äàííûõ çàáëîêèðîâàí äðóãèì ïðîöåññîì, áîëüøèíñòâî ôóíêöèé sqlite áóäóò íåçàìåäëèòåëüíî âîçâðàùàòü çíà÷åíèå <literal>SQLITE_BUSY</literal>. </para> <para> Ïðè îòêðûòèè áàçû äàííûõ,PHP óñòàíàâëèâàåò âðåìÿ îæèäàíèÿ â 60 ñåêóíä. </para> <note> <para> Îáðàòèòå âíèìàíèå, ÷òî âðåìÿ îæèäàíèÿ çàäàåòñÿ íå â ñåêóíäàõ, à â ìèëëèñåêóíäàõ. </para> </note> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_open</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-changes.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-changes.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-changes.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.6 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-changes"> <refnamediv> <refname>sqlite_changes</refname> <refpurpose> Âîçâðàùàåò êîëè÷åñòâî çàïèñåé, êîòîðûå áûëè èçìåíåíû ïîñëåäíèì SQL çàïðîñîì </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>int</type><methodname>sqlite_changes</methodname> <methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam> </methodsynopsis> <para> Âîçâðàùàåò êîëè÷åñòâî çàïèñåé, êîòîðûå áûëè èçìåíåíû ïîñëåäíèì SQL çàïðîñîì ê áàçå äàííûõ <parameter>dbhandle</parameter>. </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_num_rows</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-close.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-close.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-close.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.4 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-close"> <refnamediv> <refname>sqlite_close</refname> <refpurpose>Çàêðûâàåò áàçó äàííûõ SQLite</refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>void</type><methodname>sqlite_close</methodname> <methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam> </methodsynopsis> <para> Çàêðûâàåò áàçó äàííûõ, èäåíòèôèêàòîð ñîåäèíåíèÿ ñ êîòîðîé ïåðåäàí ÷åðåç àðãóìåíò <parameter>dbhandle</parameter>. Åñëè ñîåäèíåíèå ñ áàçîé äàííûõ áûëî ïîñòîÿííûì, òàêæå óäàëÿåò ýòî ñîåäèíåíèå èç ñïèñêà ïîñòîÿííûõ. </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_open</function> è <function>sqlite_popen</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-column.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-column.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-column.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.4 Maintainer: blinsman Status: ready --> <!-- EN-Revision: 1.4 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-column"> <refnamediv> <refname>sqlite_column</refname> <refpurpose>Âûáèðàåò îäíî ïîëå èç òåêóùåé çàïèñè ðåçóëüòàòà çàïðîñà</refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>mixed</type><methodname>sqlite_column</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> <methodparam><type>mixed</type><parameter>index_or_name</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam> </methodsynopsis> <para> Âûáèðàåò çíà÷åíèå îäíîãî ïîëÿ èç òåêóùåé çàïèñè ðåçóëüòàòà çàïðîñà <parameter>result</parameter>. Àðãóìåíò <parameter>index_or_name</parameter> çàäàåò ëèáî èìÿ ïîëÿ (åñëè ïåðåäàíà ñòðîêà), ëèáî ïîðÿäêîâûé íîìåð ïîëÿ (åñëè ïåðåäàíî öåëîå). Îïèñàíèå àðãóìåíòà <parameter>decode_binary</parameter> ñì. â îïèñàíèè ôóíêöèè <function>sqlite_fetch_array</function>. </para> <para> Ýòà ôóíêöèÿ èñïîëüçóåòñÿ ñ çàïðîñàìè, âîçâðàùàþùèìè áîëüøèå íàáîðû äàííûõ ñ áîëüøèì êîëè÷åñòâîì ïîëåé, ëèáî åñëè ïîëÿ ñîäåðæàò áîëüøèå îáúåìû äàííûõ. </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_fetch_string</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-create-aggregate.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-create-aggregate.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-create-aggregate.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.7 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-create-aggregate"> <refnamediv> <refname>sqlite_create_aggregate</refname> <refpurpose> Ðåãèñòðèðóåò àãðåãàòíóþ ôóíêöèþ äëÿ èñïîëüçîâàíèÿ â SQL çàïðîñàõ </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>bool</type><methodname>sqlite_create_aggregate</methodname> <methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam> <methodparam><type>string</type><parameter>function_name</parameter></methodparam> <methodparam><type>mixed</type><parameter>step_func</parameter></methodparam> <methodparam><type>mixed</type><parameter>finalize_func</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>num_args</parameter></methodparam> </methodsynopsis> <para> <function>sqlite_create_aggregate</function> ïîõîæà íà <function>sqlite_create_function</function>, çà èñêëþ÷åíèåì òîãî, ÷òî ðåãèñòðèðóåò ôóíêöèþ, êîòîðàÿ ìîæåò áûòü èñïîëüçîâàíà äëÿ âû÷èñëåíèÿ ðåçóëüòàòà íà îñíîâå âñåõ çàïèñåé ðåçóëüòàòà çàïðîñà. </para> <para> Ãëàâíîå îòëè÷èå ýòîé ôóíêöèè îò <function>sqlite_create_function</function> ñîñòîèò â òîì, ÷òî äëÿ ðàáîòû àãðåãàòíîé ôóíêöèè íåîõîäèìû 2 ôóíêöèè; <parameter>step_func</parameter> âûçûâàåòñÿ äëÿ êàæäîé çàïèñè èç ðåçóëüòàò çàïðîñà. Ýòà ôóíêöèÿ äîëæíà àêêóìóëèðîâàòü ðåçóëüòàò è ñîõðàíÿòü åãî â êîíòåêñòíîé ïåðåìåííîé. Ïîñëå îáðàáîòêè âñåõ çàïèñåé, âûçûâàåòñÿ <parameter>finalize_func</parameter>, êîòîðàÿ äîëæíà îáðàáîòàòü äàííûå èç êîíòåêñòíîé ïåðåìåííîé è âåðíóòü ðåçóëüòàò. </para> <para> <example> <title>Ïðèìåð àãðåãàòíîé ôóíêöèè max_length</title> <programlisting role="php"> <![CDATA[ <?php $data = array( 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', ); $dbhandle = sqlite_open(':memory:'); sqlite_query($dbhandle, "CREATE TABLE strings(a)"); foreach ($data as $str) { $str = sqlite_escape_string($str); sqlite_query($dbhandle, "INSERT INTO strings VALUES ('$str')"); } function max_len_step(&$context, $string) { if (strlen($string) > $context) { $context = strlen($string); } } function max_len_finalize(&$context) { return $context; } sqlite_create_aggregate($dbhandle, 'max_len', 'max_len_step', 'max_len_finalize'); var_dump(sqlite_array_query($dbhandle, 'SELECT max_len(a) from strings')); ?> ]]> </programlisting> </example> </para> <para>  ýòîì ïðèìåðå, ìû ñîçäàåì àãðåãàòíóþ ôóíêöèþ, êîîðàÿ âîçâðàùàåò äëèíó ñàìîé äëèííîé ñòðîêè â îäíîì èç ïîëåé ðåçóëüòàòà çàïðîñà. Äëÿ êàæäîé çàïèñè, âûçûâàåòñÿ ôóíêöèÿ <literal>max_len_step</literal>, êîòîðîé ïîìèìî ñòðîêè ïåðåäàåòñÿ êîíòåêñòíàÿ ïåðåìåííàÿ <parameter>context</parameter>. Ýòó ïåðåìåííþ âû ìîæåòå èñïîëüçîâàòü ïî ñâîåìó óñìîòðåíèþ äëÿ íàêîïëåíèÿ ðåçóëüòàòîâ âû÷èñëåíèé.  íàøåì ïðèìåðå, â ýòîé ïåðåìåííîé õðàíèòñÿ ìàêñèìàëüíàÿ äëèíà ñòðîêè; åñëè äëèíà ñòðîêè <parameter>string</parameter> áîëüøå, ÷åì çíà÷åíèå, ñîõðàíåííîå â êîíòåêñòíîé ïåðåìåííîé, êîíòåêñòíîé ïåðåìåííîé ïðèñâàèâàåòñÿ íîâîå çíà÷åíèå. </para> <para> Ïîñëå îáðàáîòêè âñåõ çàïèñåé, SQLite âûçîâåò ôóíêöèþ <literal>max_len_finalize</literal> äëÿ îïðåäåëåíèÿ ðåçóëüòàòà àãðåãàòíîé ôóíêöèè. Çäåñü ìîæíî áûëî áû ïðîâåñòè âû÷èñëåíèÿ, îñíîâàííûå íà çíà÷åíèè êîíòåêñòíîé ïåðåìåííîé <parameter>context</parameter>, íî â ýòîì ïðîñòåéøåì ïðèìåðå, âñå âû÷èñëåíèÿ áûëè ïðîèçâåäåíû â ïðîöåññå îáðàáîòêè çàïðîñà, è îñòàåòñÿ òîëüêî âåðíóòü ïîëó÷åííîå çíà÷åíèå. </para> <note> <para> Ïðèâåäåííûé âûøå ïðèìåð áóäåò ðàáîòàòü íåêîððåêòíî, åñëè ïðìåíèòü ñîçäàííóþ ôóíêöèþ ê áèíàðíûì äàííûì. Îïèñàíèå ôóíêöèè <function>sqlite_udf_decode_binary</function> îáúÿñíÿåò, ïî÷åìó ýòî ïðîèñõîäèò è êàê ýòîãî èçáåæàòü. </para> </note> <tip> <para> ÍÅ ÐÅÊÎÌÅÍÄÓÅÒÑß ñîõðàíÿòü âñå ïîëó÷åííûå çíà÷åíèÿ â êîíòåêñòíîé ïåðåìåííîé è çàòåì ïðîèçâîäèòü âñå âû÷èñëåíèÿ íà ïîñëåäíåì øàãå, òàê êàê ïðè ýòîì SQLite ìîæåò èçðàñõîäîâàòü áîëüøîå êîëè÷åñòâî ïàìÿòè â ïðîöåññå îáðàáîòêè çàïðîñà - ïðåäñòàâüòå, ñêîëüêî ïàìÿòè ïîòðåáóåòñÿ, ÷òîáû ñîõðàíèòü â ïàìÿòè ìèëëèîí çàïèñåé, ïî 32 áàéòà êàæäàÿ. </para> </tip> <tip> <para> <function>sqlite_create_function</function> è <function>sqlite_create_aggregate</function> ìîãóò áûòü èñïîëüçîâàíû äëÿ ïåðåîïðåäåëåíèÿ âñòðîåííûõ ôóíêöèé SQLite. </para> </tip> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_create_function</function>, <function>sqlite_udf_encode_binary</function> è <function>sqlite_udf_decode_binary</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-create-function.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-create-function.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-create-function.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.9 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-create-function"> <refnamediv> <refname>sqlite_create_function</refname> <refpurpose> Ðåãèñòðèðóåò ôóíêöèþ äëÿ èñïîëüçîâàíèÿ â SQL çàïðîñàõ </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>bool</type><methodname>sqlite_create_function</methodname> <methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam> <methodparam><type>string</type><parameter>function_name</parameter></methodparam> <methodparam><type>mixed</type><parameter>callback</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>num_args</parameter></methodparam> </methodsynopsis> <para> <function>sqlite_create_function</function> ïîçâîëÿåò çàðåãèñòðèðîâàòü PHP ôóíêöèþ äëÿ èñïîëüçîâàíèÿ â SQLite â êà÷åñòâå <acronym>UDF</acronym> (User Defined Function - ôóíêöèÿ, îïðåäåëåííàÿ ïîëüçîâàòåëåì), ÷òî ïîçâîëÿåò èñïîëüçîâàòü ýòó ôóíêöèþ â SQL çàïðîñàõ. </para> <para> Àðãóìåíò <parameter>dbhandle</parameter> çàäàåò áàçó äàííûõ, äëÿ êîòîðîé îïðåäåëÿåòñÿ íîâàÿ ôóíêöèÿ, <parameter>function_name</parameter> - èìÿ ôóíêöèè, êîòîðîå áóäêò èñïîëüçîâàòüñÿ â SQL çàïðîñàõ. Àðãóìåíò <parameter>callback</parameter> çàäàåò PHP ôóíêöèþ, êîòîðàÿ áóäåò âûçûâàòüñÿ ïðè îáðàùåíèè ê îïðåäåëÿåìîé SQL ôóíêöèè. Íåîáÿçàòåëüíûé àðãóìåíò <parameter>num_args</parameter> çàäàåò êîëè÷åñòâî àðãóìåíòîâ, êîòîðîå ïðèíèìàåò ôóíöèÿ. Ðåêîìåíäóåòñÿ âñåãäà ïåðåäàâàòü ýòîò àðãóìåíò, åñëè ôóíêöèÿ ïðèíèìàåò ôèêñèðîâàííîå êîëè÷åñòâî àðãóìåíòîâ. </para> <para> Îïðåäåëåííàÿ òàêèì îáðàçîì ôóíêöèÿ ìîæåò áûòü èñïîëüçîâàíà â ëþáîì SQL çàïðîñå, äîïóñêàþùåì èñïîëüçîâàíèå ôóíêöèé, íàïðèìåð SELECT è UPDATE, à òàêæå â òðèããåðàõ. </para> <para> <example> <title>Ïðèìåð èñïîëüçîâàíèÿ <function>sqlite_create_function</function></title> <programlisting role="php"> <![CDATA[ <?php function md5_and_reverse($string) { return strrev(md5($string)); } if ($dbhandle = sqlite_open('mysqlitedb', 0666, $sqliteerror)) { sqlite_create_function($dbhandle, 'md5rev', 'md5_and_reverse', 1); $sql = 'SELECT md5rev(filename) FROM files'; $rows = sqlite_array_query($dbhandle, $sql); } else { echo 'Error opening sqlite db: ' . $sqliteerror; exit; } ?> ]]> </programlisting> </example> </para> <para>  ýòîì ïðèìåðå ìû îïðåäåëÿåì ôóíêöèþ, êîòîðàÿ âû÷èñëÿåò MD5 õýø ñòðîêè, à çàòåì îáðàùàåò ïîëó÷åííóþ ñòðîêó. Ïðè âûïîëíåíèè SQL çàïðîñà, çíà÷åíèå ïîëÿ filename ïðåîáðàçóåòñÿ íàøåé ôóíêöèåé. Ìàññèâ <parameter>$rows</parameter> ñîäåðæèò îáðàáîòàííûé ðåçóëüòàò. </para> <para> Äîñòîèíñòâî ýòîé òåõíèêè â òîì, ÷òî íåò íåîáõîäèìîñòè îáðàáàòûâàòü ïîëó÷åííûé ðåçóëüòàò â öèêëå. </para> <para> Ïðè îòêðûòèè áàçû äàííûõ, ðåãèñòðèðóåòñÿ ôóíêöèÿ ñ èìåíåì <literal>php</literal>. Ýòà ôóíêöèÿ ìîæåò áûòü èñïîëüçîâàíà äëÿ âûçîâà ëþáîé ôóíêöèè PHP áåç ðåãèñòðàöèè. </para> <para> <example> <title>Ïðèìåð èñïîëüçîâàíèÿ ôóíêöèè php</title> <programlisting role="php"> <![CDATA[ <?php $rows = sqlite_array_query($dbhandle, "SELECT php('md5', filename) from files"); ?> ]]> </programlisting> <para>  ýòîì ïðèìåðå, ôóíêöèÿ <function>md5</function> áóäåò âûçâàíà äëÿ ïîëÿ <literal>filename</literal> â êàæäîé çàïèñè. </para> </example> </para> <note> <para> Äëÿ ïîâûøåíèÿ ïðîèçâîäèòåëüíîñòè, PHP íå êîäèðóåò è íå äåêîäèðóåò äàíûå, ïåðåäàâàåìûå â UDF è âîçâðàùàåìûå èç íåå. Âû äîëæíû ïîçàáîòèòüñÿ î êîäèðîâàíèè/ðàñêîäèðîâàíèè ñàìîñòîÿòåëüíî, åñëè åñòü íåîáõîäèìîñòü îáðàáàòûâàòü áèíàðíûå äàííûå. Ñìîòðèòå îïèñàíèÿ ôóíêöèé <function>sqlite_udf_encode_binary</function> è <function>sqlite_udf_decode_binary</function>. </para> </note> <tip> <para> Íå ðåêîìåíäóåòñÿ èñïîëüçîâàòü UDF äëÿ îáðàáîòêè áèíàðíûõ äàííûõ, çà èñêëþ÷åíèåì ñëó÷àåâ, êîãäà íåò íåîáõîäèìîñòè äîñòè÷ü âûñîêîãî áûñòðîäåéñòâèÿ. </para> </tip> <tip> <para> <function>sqlite_create_function</function> è <function>sqlite_create_aggregate</function> ìîãóò áûòü èñïîëüçîâàíû äëÿ ïåðåîïðåäåëåíèÿ âñòðîåííûõ ôóíêöèé SQLite. </para> </tip> </refsect1> <refsect1> &reftitle.seealso; <para> See also <function>sqlite_create_aggregate</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-current.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-current.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-current.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.6 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-current"> <refnamediv> <refname>sqlite_current</refname> <refpurpose> Âîçâðàùàåò òåêóùóþ çàïèñü ðåçóëüòàòà çàïðîñà â ìàññèâå </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>array</type><methodname>sqlite_current</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam> </methodsynopsis> <para> <function>sqlite_current</function> àíàëîãè÷íà <function>sqlite_fetch_array</function> çà èñêëþ÷åíèì òîãî, ÷òî <function>sqlite_current</function> íå ïåðåõîäèò ê ñëåäóþùåé çàïèñè ïîñëå âûáîðêè äàííûõ. </para> <para> Åñëè òåêóùàÿ ïîçèöèÿ â ðåçóëüòàòå çàïðîñà íàõîäèòñÿ çà ïîñëåäíåé çàïèñüþ, ýòà ôóíêöèÿ âîçâðàùàåò &false;. </para> &sqlite.no-unbuffered; </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_seek</function>, <function>sqlite_next</function> è <function>sqlite_fetch_array</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-error-string.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-error-string.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-error-string.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.5 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-error-string"> <refnamediv> <refname>sqlite_error_string</refname> <refpurpose>Âîçâðàùàåò ñòðîêó ñ îïèñàíèåì îøèáêè</refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>string</type><methodname>sqlite_error_string</methodname> <methodparam><type>int</type><parameter>error_code</parameter></methodparam> </methodsynopsis> <para> Âîçâðàùàåò îïèñàíèå îøèáêè ñ êîäîì <parameter>error_code</parameter>. Êîä îøèáêè âîçâðàùàåò ôóíêöèÿ <function>sqlite_last_error</function>. </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_last_error</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-escape-string.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-escape-string.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-escape-string.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.6 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-escape-string"> <refnamediv> <refname>sqlite_escape_string</refname> <refpurpose>Ýêðàíèðóåò ñïåöñèìâîëû â ñòðîêå äëÿ èñïîëüçîâàíèÿ â çàïðîñå</refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>string</type><methodname>sqlite_escape_string</methodname> <methodparam><type>string</type><parameter>item</parameter></methodparam> </methodsynopsis> <para> <function>sqlite_escape_string</function> ýêðàíèðóåò ñïåöñèìâîëû â ñòðîêå <parameter>item</parameter> äëÿ èñïîëüçîâàíèÿ â çàïðîñå SQLite. Îäèíî÷íûå êàâû÷êè (<literal>'</literal>) áóäóò óäâîåíû, à òàêæå áóäåò ïðîèçâåäåíà ïðîâåðêà íà íàëè÷èå áèíàðíûõ äàííûõ â ñòðîêå. </para> <para> Åñëè <parameter>item</parameter> ñîäåðæèò ñèìâîë <literal>NUL</literal> èëè íà÷èíàåòñÿ ñ ñèìâîëà ñ êîäîì <literal>0x01</literal>, áóäåò ïðèìåíåíåíà ñïåöèàëüíàÿ ñõåìà êîäèðîâàíèÿ, ïîçâîëÿþùàÿ áåçîïàñíî õðàíèòü áèíàðíûå äàííûå. </para> <para> Õîòÿ êîäèðîâàíèå è ïîçâîëÿåò âñòàâëÿòü áèíàðíûå äàííûå, îïåðàòîðû ñðàâíåíèÿ è <literal>LIKE</literal> äëÿ ïîëåé, ñîäåðæàùèõ òàêèå äàííûå, áóäóò ðàáîòàòü íåêîððåêòíî. Íà ïðàêòèêå, îäíàêî, ýòî íå ñîçäàåò ïðîáëåì, òàê êàê òàê áàçà äàííûõ äîëæíà áûòü ñïðîåêòèðîâàíà òàêèì îáðàçîì, ÷òîáû íå áûëî íåîáõîäèìîñòè èñïîëüçîâàòü îïåðàöèè ñðàâíåíèÿ ñ áèíàðíûìè äàííûìè. Ôàêòè÷åñêè, äëÿ õðàíåíèÿ òàêèõ äàííûõ ëó÷øå ïîäõîäÿò äðóãèå ñïîñîáû, íàïðèìåð ôàéëû. </para> <warning> <simpara> Ôóíêöèþ <function>addslashes</function> <emphasis>ÍÅËÜÇß</emphasis> èñïîëüçîâàòü äëÿ ýêðàíèðîâàíèÿ ñòðîê äëÿ çàïðîñîâ ê SQLite queries. Ýòî ïðèâåäåò ê íåîæèäàííûì ðåçóëüòàòàì ïðè âûáîðêå äàííûõ. </simpara> </warning> <note> <simpara> Íå ïðèìåíÿéòå ýòó ôóíêöèþ ê çíà÷åíèÿì, âîçâðàùàåìûì UDF, ñîçäàííûõ ñ èñïîëüçîâàíèåì <function>sqlite_create_function</function> èëè <function>sqlite_create_aggregate</function> - èñïîëüçóéòå <function>sqlite_udf_encode_binary</function>. </simpara> </note> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_udf_encode_binary</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-exec.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-exec.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-exec.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.4 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-exec"> <refnamediv> <refname>sqlite_exec</refname> <refpurpose> Âûïîëíÿåò çàïðîñ, íå âîçâðàùàþùèé çàïèñåé </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>bool</type><methodname>sqlite_exec</methodname> <methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam> <methodparam><type>string</type><parameter>query</parameter></methodparam> </methodsynopsis> <methodsynopsis> <type>bool</type><methodname>sqlite_exec</methodname> <methodparam><type>string</type><parameter>query</parameter></methodparam> <methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam> </methodsynopsis> <para> Âûïîëíÿåò çàïðîñ <parameter>query</parameter> ê áàçå äàííûõ, èäåíòèôèêàòîð êîòîðîé çàäàí àðãóìåíòîì <parameter>dbhandle</parameter>. </para> <para> Âîçâðàùàåò &true; ïðè óñïåøíîì âûïîëíåíèè çàïðîñà èëè &false; ïðè âîçíèêíîâåíèè îøèáêè. Äëÿ âûïîëíåíèÿ çàïðîñà, êîòîðûé äîëæåí âîçâðàùàòü çàïèñè, èñïîëüçóéòå <function>sqlite_query</function>. </para> <note> <simpara> Äëÿ ñîâìåñòèìîñòè ñ äðóãèìè áàçàìè äàííûõ (íàïðèìåð, MySQL), ïîääåðæèâàþòñÿ äâà âàðèàíòà ñèíòàêñèñà. Ïðåäïî÷òèòåëüíåå ïåðâûé âàðèàíò ñèíòàêñèñà, ãäå ïåðâûì ÿâëÿåòñÿ àðãóìåíò <parameter>dbhandle</parameter>. </simpara> </note> <warning> <simpara> SQLite ìîæåò âûïîëíèòü íåñêîëüêî çàïðîñîâ, ðàçäåëåííûõ òî÷êîé ñ çàïÿòîé, çà îäèí âûçîâ ôóíêöèè. Ýòî ìîæíî èñïîëüçîâàòü, íàïðèìåð, äëÿ âûïîëíåíèÿ çàïðîñîâ, ïðî÷èòàííûõ èç ôàéëà. </simpara> </warning> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_query</function>, <function>sqlite_unbuffered_query</function>, <function>sqlite_array_query</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-factory.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-factory.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-factory.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.4 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-factory"> <refnamediv> <refname>sqlite_factory</refname> <refpurpose> Îòêðûâàåò áàçó äàííûõ SQLite è âîçâðàùàåò îáúåêò </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>SQLite</type><methodname>sqlite_factory</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>mode</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter role="reference">error_message</parameter></methodparam> </methodsynopsis> &warn.undocumented.func; </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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-fetch-all.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-fetch-all.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-fetch-all.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.1 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-fetch-all"> <refnamediv> <refname>sqlite_fetch_all</refname> <refpurpose> Âûáèðàåò âñå çàïèñè èç ðåçóëüòàòà çàïðîñà è âîçâðàùàåò ìàññèâ ìàññèâîâ </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>array</type><methodname>sqlite_fetch_all</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam> </methodsynopsis> &warn.undocumented.func; </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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-fetch-array.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-fetch-array.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-fetch-array.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.6 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-fetch-array"> <refnamediv> <refname>sqlite_fetch_array</refname> <refpurpose> Âûáèðàåò ñëåäóþùóþ çàïèñü èç ðåçóëüòàòà çàïðîñà è âîçâðàùàåò ìàññèâ </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>array</type><methodname>sqlite_fetch_array</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam> </methodsynopsis> <para> Âûáèðàåò ñëåäóþùóþ çàïèñü èç ðåçóëüòàòà çàïðîñà, çàäàííîãî àðãóìåíòîì <parameter>result</parameter>. Åñëè Ðåçóëüòàò áîëüøå íå ñîäåðæèò äàííûõ, âîçâðàùàåò &false;, èíà÷å âîçâðàùàåò ìàññèâ, ñîäåðæàùèé äàííûå. </para> <para> Àðãóìåíò <parameter>result_type</parameter> ïîçâîëÿåò çàäàòü âèä âîçâðàùàåìîãî ìàññèâà. Ïî óìîë÷àíèþ èñïîëüçóåòñÿ <literal>SQLITE_BOTH</literal>, ïðè ýòîì äëÿ êàæäîãî ïîëÿ ìàññèâ áóäåò ñîäåðæàòü äâà ýëåìåíòà: ñ ÷èñëîâûì èíäåêñîì è ñòðîêîâûì èíäåêñîì (èìÿ ïîëÿ). Ïðè èñïîëüçîâàíèè <literal>SQLITE_ASSOC</literal> èíäåêñàìè ìàññèâà áóäóò òîëüêî èìåíà ïîëåé, à ïðè èñïîëüçîâàíèè <literal>SQLITE_NUM</literal> - ïîðÿäêîâûå íîìåðà ïîëåé. </para> <para> Ðåãèñòð ñèìâîëîâ â èìåíàõ ïîëåé çàâèñèò îò äèðåêòèâû <link linkend="ini.sqlite.assoc-case">sqlite.assoc_case</link>. </para> <para> Êîãäà <parameter>decode_binary</parameter> èìååò çíà÷åíèå &true;, PHP äåêîäèðóåò äàííûå, êîòîðûå áûëè çàêîäèðîâàíû ôóíêöèåé <function>sqlite_escape_string</function>.  áîëüøèíñòâå ñëó÷àåâ ñëåäóåò èñïîëüçîâàòü çíà÷åíèå ïî óìîë÷àíèþ (&true;), çà èñêëþ÷åíèåì ðàáîòû ñ áàçàìè äàííûõ, ñîçäàííûìè äðóãèìè ïðèëîæåíèÿìè. </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_array_query</function> è <function>sqlite_fetch_string</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-fetch-column-types.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-fetch-column-types.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-fetch-column-types.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.2 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-fetch-column-types"> <refnamediv> <refname>sqlite_fetch_column_types</refname> <refpurpose> Âîçâðàùàåò ìàññèâ, ñîäåðæàùèé èíôîðìàöèþ î òèïàõ ïîëåé â òàáëèöå </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>resource</type><methodname>sqlite_fetch_column_types</methodname> <methodparam><type>string</type><parameter>table_name</parameter></methodparam> <methodparam><type>resource</type><parameter>db</parameter></methodparam> </methodsynopsis> &warn.undocumented.func; </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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-fetch-object.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-fetch-object.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-fetch-object.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.1 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-fetch-object"> <refnamediv> <refname>sqlite_fetch_object</refname> <refpurpose> Âûáèðàåò ñëåäóþùóþ çàïèñü èç ðåçóëüòàòà çàïðîñà è âîçâðàùàåò îáúåêò </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>object</type><methodname>sqlite_fetch_object</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>class_name</parameter></methodparam> <methodparam choice="opt"><type>array</type><parameter>ctor_params</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam> </methodsynopsis> &warn.undocumented.func; </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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-fetch-single.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-fetch-single.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-fetch-single.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.5 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-fetch-single"> <refnamediv> <refname>sqlite_fetch_single</refname> <refpurpose> Âûáèðàåò çíà÷åíèå ïåðâîãî ïîëÿ èç ðåçóëüòàò çàïðîñà â âèäå ñòðîêè </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>string</type><methodname>sqlite_fetch_single</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam> </methodsynopsis> <para> <function>sqlite_fetch_single</function> èäåíòè÷íà <function>sqlite_fetch_array</function> çà èñêëþ÷åíèåì òîãî, ÷òî âîçâðàùàåòñÿ çíà÷åíèå òîëüêî ïåðâîãî ïîëÿ. </para> <para> Èñïîëüçîâàíèå ýòîé ôóíêöèè ÿâëÿåòñÿ îïòèìàëüíûì ñïîñîáîì ïîëó÷åíèÿ äàííûõ, êîãäà íóæíî ïîëó÷èòü çíà÷åíèå òîëüêî îäíîãî ïîëÿ. </para> <para> <example> <title>Ïðèìåð èñïîëüçîâàíèÿ <function>sqlite_fetch_single</function></title> <programlisting role="php"> <![CDATA[ <?php if ($dbhandle = sqlite_open('mysqlitedb', 0666, $sqliteerror)) { $sql = "SELECT id FROM sometable WHERE id = 42"; $res = sqlite_query($dbhandle, $sql); if (sqlite_num_rows($res) > 0) { echo sqlite_fetch_single($res); // 42 } sqlite_close($dbhandle); } ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_fetch_array</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-fetch-string.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-fetch-string.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-fetch-string.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.4 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-fetch-string"> <refnamediv> <refname>sqlite_fetch_string</refname> <refpurpose> Ïñåâäîíèì ôóíêöèè <function>sqlite_fetch_single</function> </refpurpose> </refnamediv> <refsect1> &reftitle.description; <para> Ýòà ôóíêöèÿ ÿâëÿåòñÿ ïñåâäîíèìîì ôóíêöèè <function>sqlite_fetch_single</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-field-name.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-field-name.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-field-name.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.4 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-field-name"> <refnamediv> <refname>sqlite_field_name</refname> <refpurpose>Âîçâðàùàåò èìÿ óêàçàííîãî ïîëÿ ðåçóëüòàòà çàïðîñà </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>string</type><methodname>sqlite_field_name</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> <methodparam><type>int</type><parameter>field_index</parameter></methodparam> </methodsynopsis> <para> Âîçâðàùàåò èìÿ ïîëÿ ðåçóëüòàòà çàïðîñà <parameter>result</parameter> ñ ïîðÿäêîâûì íîìåðîì <literal>field_index</literal>. </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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-has-more.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-has-more.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-has-more.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.4 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-has-more"> <refnamediv> <refname>sqlite_has_more</refname> <refpurpose> Îïðåäåëÿåò, åñòü ëè åùå çàïèñè â ðåçóëüòàòå çàïðîñà </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>bool</type><methodname>sqlite_has_more</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> <para> <function>sqlite_has_more</function> âîçâðàùàåò &true; åñëè ðåçóëüòàò çàïðîñà <parameter>result</parameter> ñîäåðæèò çàïèñè, äîñòóïíûå äëÿ âûáîðêè, èíà÷å âîçâðàùàåò &false;. </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_num_rows</function> è <function>sqlite_changes</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-has-prev.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-has-prev.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-has-prev.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.1 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-has-prev"> <refnamediv> <refname>sqlite_has_prev</refname> <refpurpose> Îïðåäåëÿåò, äîñòóïíà ëè ïðåäûäóùàÿ çàïèñü </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>bool</type><methodname>sqlite_has_prev</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> <para> <function>sqlite_has_prev</function> âîçâðàùàåò &true; åñëè ïðåäûäóùàÿ çàïèñü ðåçóëüòàòà çàïðîñà <parameter>result</parameter> äîñòóïíà, èíà÷å âîçâðàùàåò &false;. </para> &sqlite.no-unbuffered; </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_prev</function>, <function>sqlite_has_more</function> è <function>sqlite_num_rows</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-last-error.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-last-error.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-last-error.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.6 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-last-error"> <refnamediv> <refname>sqlite_last_error</refname> <refpurpose>Âîçâðàùàåò êîä îøèáêè ïîñëåäíåé îïåðàöèè ñ SQLite</refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>int</type><methodname>sqlite_last_error</methodname> <methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam> </methodsynopsis> <para> Âîçâðàùàåò êîä îøèáêè ïîñëåäíåé îïåðàöèè ñ áàçîé äàííûõ ñ èäåíòèôèêàòîðîì <parameter>dbhandle</parameter>. Îïèñàíèå îøèáêè ìîæíî ïîëó÷èòü ñ ïîìîùüþ ôóíêöèè <function>sqlite_error_string</function>. </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_error_string</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-last-insert-rowid.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-last-insert-rowid.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-last-insert-rowid.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.6 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-last-insert-rowid"> <refnamediv> <refname>sqlite_last_insert_rowid</refname> <refpurpose> Âîçâðàùàåò èäåíòèôèêàòîð ïîñëåäíåé âñòàâëåííîé çàïèñè </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>int</type><methodname>sqlite_last_insert_rowid</methodname> <methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam> </methodsynopsis> <para> Âîçâðàùàåò èäåíòèôèêàòîð ïîñëåäíåé çàïèñè, âñòàâëåííîé â áàçó äàííûõ <parameter>dbhandle</parameter>, åñëè òàáëèöà, â êîòîðóþ áûëà âñòàâëåíà çàïèñü, ñîäåðæèò ïîëå ñ àâòî-èíêðåìåíòîì. </para> <tip> <para> Ïîëÿ ñ àâòî-èíêðåìåíòîì â SQLite îáúÿâëÿþòñÿ êàê <literal>INTEGER PRIMARY KEY</literal>. </para> </tip> </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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-libencoding.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-libencoding.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-libencoding.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.6 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-libencoding"> <refnamediv> <refname>sqlite_libencoding</refname> <refpurpose> Âîçâðàùàåò êîäèðîâêó, èñïîëüçóåìóþ ïîäêëþ÷åííîé áèáëèîòåêîé SQLite </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>string</type><methodname>sqlite_libencoding</methodname> <void/> </methodsynopsis> <para> SQLite ìîæåò áûòü ñêîìïèëèðîâàíà ñ ïîääåðæêîé ISO-8859-1 èëè UTF-8. Ýòà ôóíêöèÿ ïîçâîëÿåò îïðåäåëèò, êàêóþ êîäèðîâêó èñïîëüçóåò ïîäêëþ÷åííàÿ áèáëèîòåêà. </para> <warning> <para> Ïî óìîë÷àíèþ, PHP êîìïèëèðóåò libsqlite ñ êîäèðîâêîé ISO-8859-1. Îäíàêî, ýòî íåâåðíîå íàçâàíèå; âìåñòî èñïîëüçîâàíèÿ ISO-8859-1, libsqlite ðàáîòàåò â ñîîòâåòñòâèè ñ óñòàíîâêàìè òåêóùåé ëîêàëè äëÿ ñðàâíåíèÿ è ñîðòèðîâêè ñòðîê. Ïîýòîìó ñëåäóåò ñ÷èòàòü, ÷òî èñïîëüçóåòñÿ íå ISO-8859-1, à êîäèðîâêà '8-bit'. </para> </warning> <para> Ïðè êîìïèëÿöèè ñ ïîääåðæêîé UTF-8 sqlite êîððåêòíî ðàñïîçíàåò ìíîãîáàéòíûå ñèìâîëû UTF-8, îäíàêî ïîääåðæêà UTF-8 âñå æå íåïîëíàÿ (íàïðèìåð, íå ïðîèçâîäèòñÿ íîðìàëèçàöèÿ); êðîìå òîãî, íåêîððåêòíî âûïîëíÿþòñÿ íåêîòîðûå îïåðàöèè ñðàâíåíèÿ. </para> <warning> <para>  web-îêðóæåíèè íå ðåêîìåíäóåòñÿ èñïîëüçîâàòü PHP è SQLite ñ ïîääåðæêîé UTF-8, òàê êàê libsqlite çàâåðøàåò ïðîöåññ ïðè îáíàðóæåíèè ïðîáëåì ñ êîäèðîâêîé UTF-8. </para> </warning> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_libversion</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-libversion.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-libversion.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-libversion.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.5 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-libversion"> <refnamediv> <refname>sqlite_libversion</refname> <refpurpose>Âîçâðàùàåò âåðñèþ ïîäêëþ÷åííîé áèáëèîòåêè SQLite</refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>string</type><methodname>sqlite_libversion</methodname> <void/> </methodsynopsis> <para> Âîçâðàùàåò âåðñèþ ïîäêëþ÷åííîé áèáëèîòåêè SQLite. </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_libencoding</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-next.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-next.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-next.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.6 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-next"> <refnamediv> <refname>sqlite_next</refname> <refpurpose>Ïåðåõîäèò íà ñëåäóþùóþ çàïèñü</refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>bool</type><methodname>sqlite_next</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> <para> <function>sqlite_next</function> ïåðåìåùàåò âíóòðåííèé óêàçàòåëü ðåçóëüòàòà çàïðîñà <parameter>result</parameter> íà ñëåäóþùóþ çàïèñü. Âîçâðàùàåò &false; åñëè óêàçàòåëü íàõîäèëñÿ íà ïîñëåäíåé çàïèñè ïåðåä âûçîâîì ôóíêöèè, èíà÷å âîçâðàùàåò &true;. </para> &sqlite.no-unbuffered; </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_seek</function>, <function>sqlite_current</function> è <function>sqlite_rewind</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-num-fields.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-num-fields.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-num-fields.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.5 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-num-fields"> <refnamediv> <refname>sqlite_num_fields</refname> <refpurpose>Âîçâðàùàåò êîëè÷åñòâî ïîëåé â ðåçóëüòàòå çàïðîñà</refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>int</type><methodname>sqlite_num_fields</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> <para> Âîçâðàùàåò êîëè÷åñòâî ïîëåé â ðåçóëüòàòå çàïðîñà <parameter>result</parameter>. </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_column</function> è <function>sqlite_num_rows</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-num-rows.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-num-rows.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-num-rows.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.5 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-num-rows"> <refnamediv> <refname>sqlite_num_rows</refname> <refpurpose>Âîçâðàùàåò êîëè÷åñòâî çàïèñåé â ðåçóëüòàòå çàïðîñà</refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>int</type><methodname>sqlite_num_rows</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> <para> Âîçâðàùàåò êîëè÷åñòâî çàïèñåé â ðåçóëüòàòå çàïðîñà <parameter>result</parameter>. </para> &sqlite.no-unbuffered; </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_changes</function> b <function>sqlite_query</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-open.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-open.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-open.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.12 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-open"> <refnamediv> <refname>sqlite_open</refname> <refpurpose>Îòêðûâàåò èëè ñîçäàåò áàçó äàííûõ SQLite</refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>resource</type><methodname>sqlite_open</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>mode</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter role="reference">error_message</parameter></methodparam> </methodsynopsis> <para> Âîçâðàùàåò ðåñóðñ (èäåíòèôèêàòîð áàçû äàííûõ) ïðè óñïåøíîì çàâåðøåíèè, &false; ïðè âîçíèêíîâåíèè îøèáêè. </para> <para> Àðãóìåíò <parameter>filename</parameter> çàäàåò èìÿ áàçû äàííûõ. Ýòî ìîæåò áûòü àáñîëþòíûé èëè îòíîñèòåëüíûé ïóòü ê ôàéëó, â êîòîðîì áóäóò õðàíèòüñÿ äàííûå. Åñëè ôàéë íå ñóùåñòâóåò, áóäåò ïðåäïðèíÿòà ïîïûòêà åãî ñîçäàíèÿ. Ó ïîëüçîâàòåëÿ, îò èìåíè êîòîðîãî âûïîëíÿåòñÿ ñêðèïò, <emphasis>ÄÎËÆÍÛ</emphasis> áûòü ïðàâà íà çàïèñü â ôàéë, åñëè íåîáõîäèìî äîáàâëÿòü äàííûå èëè èçìåíÿòü ñòðóêòóðó äàííûõ. </para> <para> Àðãóìåíò <parameter>mode</parameter> çàäàåò ðåæèì äîñòóïà ê ôàéëó áàçû äàííûõ, è ìîã áû èñïîëüçîâàòüñÿ äëÿ îòêðûòèÿ áàçû äàííûõ òîëüêî äëÿ ÷òåíèÿ, îäíàêî â íàñòîÿùåå âðåìÿ ýòîò àðãóìåíò íå èñïîëüçóåòñÿ. Ðåêîìåíäóåòñÿ èñïîëüçîâàòü âîñüìåðè÷íîå <literal>0666</literal> â êà÷åñòâå çíà÷åíèÿ ýòîãî àðãóìåíòà, åñëè íåîáõîäèìî èñïîëüçîâàòü àðãóìåíò <parameter>errmessage</parameter>. </para> <para> Àðãóìåíò <parameter>errmessage</parameter> ïåðåäàåòñÿ ïî ññûëêå, â íåì âîçâðàùàåòñÿ ñîîáùåíèå îá îøèáêå. </para> <para> <example> <title>Ïðèìåð <function>sqlite_open</function></title> <programlisting role="php"> <![CDATA[ <?php if ($db = sqlite_open('mysqlitedb', 0666, $sqliteerror)) { sqlite_query($db, 'CREATE TABLE foo (bar varchar(10))'); sqlite_query($db, "INSERT INTO foo VALUES ('fnord')"); $result = sqlite_query($db, 'select bar from foo'); var_dump(sqlite_fetch_array($result)); } else { die($sqliteerror); } ?>]]> </programlisting> </example> </para> <tip> <simpara> Íà Unix-ïîäîáíûõ ñèñòåìàõ, SQLite ìîæåò ðàáîòàòü íåêîððåêòíî â ïðîãðàììàõ, èñïîëüçóþùèõ âûçîâ fork().  òàêèõ ïðîãðàììàõ ðåêîìåíäóåòñÿ çàêðûâàòü áàçó äàííûõ ïåðåä çàïóñêîì äî÷åðíåãî ïðîöåññà è çàòåì çàíîâî îòêðûâàòü åå â äî÷åðíåì è/èëè ðîäèòåëüñêîì ïðîöåññå. Äîïîëíèòåëüíàÿ èíôîðìàöèÿ î ïðîáëåìå ñîäåðæèòñÿ â <ulink url="&url.sqlite.interface.c;">îïèñàíèè èíòåðôåéñà SQLite íà ÿçûêå C</ulink> â ðàçäåëå <literal>Multi-Threading And SQLite</literal>. </simpara> </tip> <tip> <simpara> Íå ðåêîìåíäóåòñÿ ðàáîòàòü ñ áàçàìè äàííûõ SQLite ÷åðåç NFS, èç-çà âîçìîæíûõ ïðîáëåì ñ áëîêèðîâêîé ôàéëà. </simpara> </tip> <note> <simpara> Íà÷èíàÿ SQLite âåðñèè 2.8.2, ìîæíî óêàçûâàòü <literal>:memory:</literal> â êà÷åñòâå çíà÷åíèÿ àðãóìåíòà <parameter>filename</parameter> äëÿ ñîçäàíèÿ áàçû äàííûõ â ïàìÿòè. Ýòî ìîæåò áûòü ïîëåçíî â òåõ ñëó÷àÿõ, êîãäà íåîáõîäèìî ñîçäàíèå âðåìåííîé áàçû äàííûõ, êîòîðàÿ äîëæíà áûòü óíè÷òîæåíà ïðè çàâåðøåíèè ïðîöåññà. Òàêæå ýòî ìîæåò èñïîëüçîâàòüñÿ ñîâìåñòíî ñ êîìàíäîé <literal>ATTACH DATABASE</literal> äëÿ ïîäêëþ÷åíèÿ äðóãèõ áàç äàííûõ è âûïîëíåíèÿ îïåðàöèé ñ íèìè. </simpara> </note> <note> <simpara> Ìîäóëü SQLite ó÷èòûâàåò óñòàíîâêè &safemode; è open_basedir. </simpara> </note> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_popen</function>, <function>sqlite_close</function> è <function>sqlite_query</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-popen.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-popen.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-popen.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.9 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-popen"> <refnamediv> <refname>sqlite_popen</refname> <refpurpose> Îòêðûâàåò èëè ñîçäàåò áàçó äàííûõ SQLite, äåëàÿ ïîäêëþ÷åíèå ïîñòîÿííûì </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>resource</type><methodname>sqlite_popen</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>mode</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter role="reference">error_message</parameter></methodparam> </methodsynopsis> <simpara> Ýòà ôóíêöèÿ èäåíòè÷íà <function>sqlite_open</function>, çà èñêëþ÷åíèåì òîãî, ÷òî îíà èñïîëüçóåò ìåõàíèçì ïîñòîÿííûõ ñîåäèíåíèé PHP. Îïèñàíèå àðãóìåíòîâ â îïèñàíèè ôóíêöèè <function>sqlite_open</function>. </simpara> <para> <function>sqlite_popen</function> ïûòàåòñÿ íàéòè óæå îòêðûòûé èäåíòèôèêàòîð ïîäêëþ÷åíèÿ ê ôàéëó <parameter>filename</parameter>. Åñëè òàêîé óêàçàòåëü îáíàðóæåí, ôóíêöèÿ âîçâðàùàåò åãî, èíà÷å îòêðûâàåò ôàéë àíàëîãè÷íî ôóíêöèè <function>sqlite_open</function>. </para> <para> Âûãîäà îò èñïîëüçîâàíèÿ ïîñòîÿííîãî ïîäêëþ÷åíèÿ çàêëþ÷àåòñÿ â òîì, ÷òî íå òðàòèòñÿ âðåìÿ íà îòêðûòèå ôàéëà è ÷òåíèå ñòðóêòóðû äàííûõ ïðè êàæäîì çàïðîñå. Ýòî ñïðàâåäëèâî òîëüêî â ñëó÷àå èñïîëüçîâàíèÿ PHP êàê ìîäóëÿ web-ñåðâåðà (íî íå CGI èëè CLI). </para> <note> <simpara> Ïðè èñïîëüçîâàíèè ïîñòîÿííûõ ïîäêëþ÷åíèé íåîáõîäèìî ñëåäèòü çà òåì, ÷òîáû ôàéë áàçó äàííûõ íå ïåðåçàïèñûâàëñÿ âíåøíèìè ïðîöåñàìè (íàïðèìåð, ïðîãðàììîé, çàïóùåííîé ñ ïîìîùüþ crontab, êîòîðàÿ ñîçäàåò íîâûé ôàéë áàçû äàííûõ, à çàòåì êîïèðóåò åãî íà ìåñòî îðèãèíàëüíîãî ôàéëà), òàê êàê ýòî âûçîâåò íåïðåäñêàçóåìûå ïîñëåäñòâèÿ. </simpara> <simpara> Åñëè íåîáõîäèìà ìîäèôèêàöèÿ áàçû äàííûõ âíåøíèì ïðîöåññîì, òî ýòîò ïðîöåññ äîëæåí ðàáîòàòü òîëüêî ñ îðèãèíàëüíûì ôàéëîì è èñïîëüçîâàòü òðàíçàêöèè. </simpara> </note> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_open</function>, <function>sqlite_close</function> è <function>sqlite_query</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-prev.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-prev.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-prev.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.1 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-prev"> <refnamediv> <refname>sqlite_prev</refname> <refpurpose>Ïåðåõîäèò íà ïðåäûäóùóþ çàïèñü</refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>bool</type><methodname>sqlite_prev</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> <para> <function>sqlite_prev</function> ïåðåìåùàåò âíóòðåííèé óêàçàòåëü ðåçóëüòàòà çàïðîñà <parameter>result</parameter> íà ïðåäûäóùóþ çàïèñü. Âîçâðàùàåò &false; åñëè óêàçàòåëü íàõîäèòñÿ íà ïåðâîé çàïèñè â ìîìåíò âûçîâà ôóíêöèè, èíà÷å &true;. </para> &sqlite.no-unbuffered; </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_has_prev</function>, <function>sqlite_rewind</function> è <function>sqlite_next</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-query.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-query.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-query.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.11 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-query"> <refnamediv> <refname>sqlite_query</refname> <refpurpose> Âûïîëíÿåò çàïðîñ ê áàçå äàííûõ è âîçâðàùàåò èäåíòèôèêàòîð ðåçóëüòàòà </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>resource</type><methodname>sqlite_query</methodname> <methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam> <methodparam><type>string</type><parameter>query</parameter></methodparam> </methodsynopsis> <methodsynopsis> <type>resource</type><methodname>sqlite_query</methodname> <methodparam><type>string</type><parameter>query</parameter></methodparam> <methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam> </methodsynopsis> <para> Âûïîëíÿåò SQL çàïðîñ <parameter>query</parameter> ê áàçå äàííûõ, çàäàííîé àðãóìåíòîì <parameter>dbhandle</parameter>. </para> <para> Ýòà ôóíêöèÿ âîçâðàùàåò èäåíòèôèêàòîð ðåçóëüòàòà çàïðîñà èëè &false; â ñëó÷àå îøèáêè. Äëÿ çàïðîñîâ, âîçâðàùàþùèõ äàííûå, ýòîò èäåíòèôèêàòîð ìîæåò èñïîëüçîâàòüñÿ â êà÷åñòâå àðãóìåíòà òàêèõ ôóíêöèé êàê <function>sqlite_fetch_array</function> èëè <function>sqlite_seek</function>. </para> <para> Íåçàâèñèìî îò òèïà çàïðîñà, â ñëó÷àå âîçíèêíîâåíèÿ îøèáêè ýòà ôóíêöèÿ âîçâðàùàåò &false;. </para> <para> <function>sqlite_query</function> ñîõðàíÿåò âûáðàííûå çàïèñè â áóôåðå, ÷òî ïîçâîëÿåò ïåðåáèðàòü âîçâðàùåííûå çàïèñè â ïðîèçâîëüíîì ïîðÿäêå. Ÿ ñëåäóåò èñïîëüçîâàòü òîëüêî äëÿ çàïðîñîâ, âîçâðàùàþùèõ îòíîñèòåëüíî íåáîëüøîå êîëè÷åñòâî çàïèñåé. Åñëè âàì íåîáõîäèì òîëüêî ïîñëåäîâàòåëüíûé äîñòóï ê çàïèñÿì, ðåêîìåíäóåòñÿ èïîëüçîâàòü ôóíêöèþ <function>sqlite_unbuffered_query</function>, êîòîðàÿ âûïîëíÿåòñÿ áûñòðåå è ïîòðåáëÿåò ìåíüøå ïàìÿòè. </para> <note> <simpara> Äâà âàðèàíòà ñèíòàêñèñà èñïîëüçóþòñÿ äëÿ îáåñïå÷åíèÿ ñîâìåñòèìîñòè ñ äðóãèìè ìîäóëÿìè äëÿ ðàáîòû ñ áàçàìè äàííûõ (íàïðèìåð MySQL). Ïðåäïî÷òèòåëüíîé ÿâëÿåòñÿ ïåðâàÿ ôîðìà çàïèñè, èñïîëüçóþùàÿ <parameter>dbhandle</parameter> â êà÷åñòâå ïåðâîãî àðãóìåíòà. </simpara> </note> <warning> <simpara> SQLite <emphasis>âûïîëíÿåò</emphasis> íåñêîëüêî çàïðîñîâ, ðàçäåëåííûõ òî÷êîé ñ çàïÿòîé, ÷òî ìîæíî èñïîëüçîâàòü, íàïðèìåð, äëÿ âûïîëíåíèÿ çàïðîñîâ, ïðî÷èòàííûõ èç ôàéëà. Îäíàêî, åñëè õîòÿ áû îäèí èç çàïðîñîâ äîëæåí âîçâðàùàòü íàáîð çàïèñåé (SELECT), òî áóäåò âûïîëíåí òîëüêî ïåðâûé çàïðîñ. Ôóíêöèÿ <function>sqlite_exec</function> âñåãäà âûïîëíÿåò âñå çàïðîñû. </simpara> <simpara> Ïðè âûïîëíåíèè íåñêîëüêèõ çàïðîñîâ, ýòà ôóíêöèÿ âîçâðàùàåò &false; â ñëó÷àå îøèáêè, èíà÷å âîçâðàùàåòñÿ ëèáî &true;, ëèáî èäåíòèôèêàòîð ðåçóëüòàòà çàïðîñà. </simpara> </warning> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_unbuffered_query</function> and <function>sqlite_array_query</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-rewind.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-rewind.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-rewind.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.6 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-rewind"> <refnamediv> <refname>sqlite_rewind</refname> <refpurpose>Ïåðåõîäèò ê ïåðâîé çàïèñè</refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>bool</type><methodname>sqlite_rewind</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> </methodsynopsis> <para> <function>sqlite_rewind</function> ïåðåìåùàåò âíóòðåííèé óêàçàòåëü ðåçóëüòàòà çàïðîñà íà ïåðâóþ çàïèñü. Âîçâðàùàåò &false; åñëè ðåçóëüòàò çàïðîñà íå ñîäåðæèò çàïèñåé, èíà÷å &true;. </para> &sqlite.no-unbuffered; </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_next</function>, <function>sqlite_current</function> è <function>sqlite_seek</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-seek.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-seek.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-seek.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.8 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-seek"> <refnamediv> <refname>sqlite_seek</refname> <refpurpose>Ïåðåõîäèò ê îïðåäåëåííîìó íîìåðó çàïèñè</refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>bool</type><methodname>sqlite_seek</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> <methodparam><type>int</type><parameter>rownum</parameter></methodparam> </methodsynopsis> <para> <function>sqlite_seek</function> ïåðåìåùàåò âíóòðåííèé óêàçàòåëü ðåçóëüòàòà çàïðîñà íà çàïèñü ñ ïîðÿäêîâûì íîìåðîì, çàäàííûì àðãóìåíòîì <parameter>rownum</parameter>. Íóìåðàöèÿ çàïèñåé íà÷èíàåòñÿ ñ íóëÿ (0 ñîîòâåòñòâóåò ïåðâîé çàïèñè). Âîçâðàùàåò &false; åñëè çàïèñü ñ óêàçàííûì íîìåðîì îòñóòñòâóåò, èíà÷å &true;. </para> &sqlite.no-unbuffered; </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_next</function>, <function>sqlite_current</function> è <function>sqlite_rewind</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-single-query.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-single-query.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-single-query.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.1 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-single-query"> <refnamediv> <refname>sqlite_single_query</refname> <refpurpose> Âûïîëíÿåò SQL çïðîñ è âîçâðàùàåò ìàññèâ ñî çíà÷åíèÿìè îäíîãî ïîëÿ èëè ïåðâóþ çàïèñü </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>mixed</type><methodname>sqlite_single_query</methodname> <methodparam><type>resource</type><parameter>db</parameter></methodparam> <methodparam><type>string</type><parameter>query</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>first_row_only</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>decode_binary</parameter></methodparam> </methodsynopsis> &warn.undocumented.func; </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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-udf-decode-binary.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-udf-decode-binary.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-udf-decode-binary.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.5 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-udf-decode-binary"> <refnamediv> <refname>sqlite_udf_decode_binary</refname> <refpurpose> Äåêîäèðóåò áèíàðíûå äàííûå, ïåðåäàííûå â ïîëüçîâàòåëüñêóþ ôóíêöèþ </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>string</type><methodname>sqlite_udf_decode_binary</methodname> <methodparam><type>string</type><parameter>data</parameter></methodparam> </methodsynopsis> <para> <function>sqlite_udf_decode_binary</function> äåêîäèðóåò áèíàðíûå äàííûå, çàêîäèðîâàííûå ôóíêöèÿìè <function>sqlite_udf_encode_binary</function> èëè <function>sqlite_escape_string</function>. </para> <para> Ýòó ôóíêöèþ ñëåäóåò ïðèìåíÿòü ê àðãóìåíòàì, ïåðåäàííûì â ïîëüçîâàòåëüñêóþ ôóíêöèþ, åñëè â ýòèõ àðãóìåíòàõ ìîãóò ñîäåðæàòüñÿ áèíàðíûå äàííûå. </para> <para> Äåêîäèðîâàíèå íå ïðèìåíÿåòñÿ ê àðãóìåíòàì àâòîìàòè÷åñêè, òàê êàê ýòî íåãàòèâíî ñêàçûâàåòñÿ íà ïðîèçâîäèòåëüíîñòè. Ïðèìåíÿéòå ýòó ôóíêöèþ òîëüêî òàì, ãäå ýòî äåéñòâèòåëüíî íåîáõîäèìî. </para> <para> <example> <title> Ïðèìåð ðåàëèçàöèè àãðåãàòíîé ôóíêöèè max_length, ñïîñîáíîé ðàáîòàòü ñ áèíàðíûìè äàííûìè </title> <programlisting role="php"> <![CDATA[ <?php $data = array( 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', ); $db = sqlite_open(':memory:'); sqlite_query($db, "CREATE TABLE strings(a)"); foreach ($data as $str) { $str = sqlite_escape_string($str); sqlite_query($db, "INSERT INTO strings VALUES ('$str')"); } function max_len_step(&$context, $string) { $string = sqlite_udf_decode_binary($string); if (strlen($string) > $context) { $context = strlen($string); } } function max_len_finalize(&$context) { return $context; } sqlite_create_aggregate($db, 'max_len', 'max_len_step', 'max_len_finalize'); var_dump(sqlite_array_query($db, 'SELECT max_len(a) from strings')); ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_udf_encode_binary</function>, <function>sqlite_create_function</function> and <function>sqlite_create_aggregate</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-udf-encode-binary.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-udf-encode-binary.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-udf-encode-binary.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.4 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-udf-encode-binary"> <refnamediv> <refname>sqlite_udf_encode_binary</refname> <refpurpose> Êîäèðóåò áèíàðíûå äàííûå, âîçâðàùàåìûå ïîëüçîâàòåëüñêîé ôóíêöèåé </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>string</type><methodname>sqlite_udf_encode_binary</methodname> <methodparam><type>string</type><parameter>data</parameter></methodparam> </methodsynopsis> <para> <function>sqlite_udf_encode_binary</function> êîäèðóåò áèíàðíûå äàííûå <parameter>data</parameter> òàêèì îáðàçîì, ÷òî îíè ìîãóò áûòü âîçâðàùåíû â êà÷åñòâå ðåçóëüòàòà çàïðîñà (òàê êàê áèáëèîòåêà libsqlite íåáåçîïàñíà äëÿ îáðàáîòêè áèíàðíûõ äàííûõ). </para> <para> Åñëè äàííûå ìîãóò áûòü áèíàðíûìè (íàïðèìåð, ñîäåæàòü NUL â ñåðåäèíå ñòðîêè èëè áàéò <literal>0x01</literal> â íà÷àëå ñòðîêè), òî òàêèå äàííûå ñëåäóåò çàêîäèðîâàòü ýòîé ôóíêöèåé ïåðåä òåì, êàê âîçâðàùàòü èõ èç ïîëüçîâàòåëüñêîé ôóíêöèè. </para> <para> Êîäèðîâàíèå íå ïðèìåíÿåòñÿ ê âîçâðàùàåìûì äàííûì àâòîìàòè÷åñêè, òàê êàê ýòî íåãàòèâíî ñêàçûâàåòñÿ íà ïðîèçâîäèòåëüíîñòè. Ïðèìåíÿéòå ýòó ôóíêöèþ òîëüêî òàì, ãäå ýòî äåéñòâèòåëüíî íåîáõîäèìî. </para> <note> <para> Íå èñïîëüçóéòå ôóíêöèþ <function>sqlite_escape_string</function> äëÿ ýêðàíèðîâàíèÿ ñòðîê, âîçâðàùàåìûõ èç ïîëüçîâàòåëüñêîé ôóíêöèè, òàê êà ýòî ïðèâåäåò ê äâîéíîìó ýêðàíèðîâàíèþ. Èñïîëüçóéòå <function>sqlite_udf_encode_binary</function> ! </para> </note> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_udf_decode_binary</function>, <function>sqlite_escape_string</function>, <function>sqlite_create_function</function> and <function>sqlite_create_aggregate</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 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/co.php/phpdoc-ru/reference/sqlite/functions/sqlite-unbuffered-query.xml?r=1.1&p=1 Index: phpdoc-ru/reference/sqlite/functions/sqlite-unbuffered-query.xml +++ phpdoc-ru/reference/sqlite/functions/sqlite-unbuffered-query.xml <?xml version="1.0" encoding="windows-1251"?> <!-- EN-Revision: 1.5 Maintainer: blindman Status: ready --> <!-- $Revision: 1.1 $ --> <refentry id="function.sqlite-unbuffered-query"> <refnamediv> <refname>sqlite_unbuffered_query</refname> <refpurpose> Âûïîëíÿåò çàïðîñ áåç áóôåðèçàöèè ðåçóëüòàòîâ </refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>resource</type><methodname>sqlite_unbuffered_query</methodname> <methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam> <methodparam><type>string</type><parameter>query</parameter></methodparam> </methodsynopsis> <methodsynopsis> <type>resource</type><methodname>sqlite_unbuffered_query</methodname> <methodparam><type>string</type><parameter>query</parameter></methodparam> <methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam> </methodsynopsis> <para> <function>sqlite_unbuffered_query</function> èäåíòè÷íà ôóíêöèè <function>sqlite_query</function> çà èñêëþ÷åíèåì òîãî, ÷òî çàïèñè èç âîçâðàùàåìîãî ðåçóëüòàòà ìîæíî ïîëó÷àòü òîëüêî ïîñëåäîâàòåëüíî, îäíó çà äðóãîé. </para> <para> Ýòà ôóíêöèÿ èäåàëüíî ïîäõîäèò äëÿ òåõ ñëó÷àåâ, êîãäà íóæíî ïîñëåäîâàòåëüíî îáðàáîòàòü çàïèñè èç ðåçóëüòàòà çàïðîñà è íåò íåîáõîäèìîñòè â äîñòóïå ê ïðîèçâîëüíîé çàïèñè ðåçóëüòàòà çàïðîñà, íàïðèìåð ïðè âûâîäå äàííûõ èç áàçû äàííûõ â âèäå HTML òàáëèöû. </para> <note> <para> Ôóíêöèè <function>sqlite_seek</function>, <function>sqlite_rewind</function>, <function>sqlite_next</function>, <function>sqlite_current</function> è <function>sqlite_num_rows</function> íå ðàáîòàþò ñ ðåçóëüòàòàìè, âîçâðàùàåìûìè ôóíêöèåé <function>sqlite_unbuffered_query</function>. </para> </note> </refsect1> <refsect1> &reftitle.seealso; <para> <function>sqlite_query</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 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.ru (#528) next »