mirror of
https://github.com/php/doc-ja.git
synced 2026-03-25 15:42:08 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@297032 c90b9560-bf6c-de11-be94-00142212c4b1
113 lines
3.8 KiB
XML
113 lines
3.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: hirokawa Status: ready -->
|
|
<!-- CREDITS: shimooka -->
|
|
<refentry xml:id="function.sqlite-escape-string" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>sqlite_escape_string</refname>
|
|
<refpurpose>クエリパラメータ用に文字列をエスケープする</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&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 SQLステートメントで使用できるように正しくクオートします。
|
|
この際、シングルクオート(<literal>'</literal>)は2重にされ、
|
|
クエリ文字列のバイナリセーフでない文字がチェックされます。
|
|
</para>
|
|
<para>
|
|
このエンコーディングは、データ挿入を安全に行いますが、
|
|
テキスト比較は単純化され、バイナリデータを含むカラムについては
|
|
クエリの中で<literal>LIKE</literal>句を使用できません。
|
|
実際には、バイナリカラムでこのようなことをするスキーマにはしないの
|
|
で、これが問題になることはないでしょう
|
|
(実際には、ファイルのような他の手段でバイナリデータを保存する方が良
|
|
いでしょう)。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>item</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
クォートしたい文字列。
|
|
</para>
|
|
<para>
|
|
<parameter>item</parameter>が<literal>NUL</literal>文字を含む場合、
|
|
または、16進表現の<literal>0x01</literal>で始まる場合、
|
|
PHPはバイナリデータを安全に保存/取得するためのバイナリエンコーディ
|
|
ングを適用します。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
SQLite の SQL 文で使用できる形式にエスケープした文字列を返します。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<note>
|
|
<simpara>
|
|
この関数を
|
|
<function>sqlite_create_function</function>または
|
|
<function>sqlite_create_aggregate</function>により作成したUDFから
|
|
返す値をエンコードするために使用しないでください。
|
|
代わりに <function>sqlite_udf_encode_binary</function> を使用して
|
|
ください。
|
|
</simpara>
|
|
</note>
|
|
<warning>
|
|
<simpara>
|
|
<function>addslashes</function>をSQLiteクエリの文字列をクオート
|
|
するために使用するべきではありません。さもないと、
|
|
データを取得する際に奇妙な結果を発生する可能性があります。
|
|
</simpara>
|
|
</warning>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>sqlite_udf_encode_binary</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|