1
0
mirror of https://github.com/php/doc-ja.git synced 2026-03-30 19:12:28 +02:00
Files
archived-doc-ja/reference/sqlite/functions/sqlite-escape-string.xml
Hideyuki Shimooka 79c9e5e4fd sync with en
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@190387 c90b9560-bf6c-de11-be94-00142212c4b1
2005-07-10 05:58:06 +00:00

86 lines
3.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.5 $ -->
<!-- EN-Revision: 1.7 Maintainer: hirokawa Status: ready -->
<!-- CREDITS: shimooka -->
<refentry id="function.sqlite-escape-string">
<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>
<parameter>item</parameter><literal>NUL</literal>文字を含む場合、
または、16進表現の<literal>0x01</literal>で始まる場合、
PHPはバイナリデータを安全に保存/取得するためのバイナリエンコーディ
ングを適用します。
</para>
<para>
このエンコーディングは、データ挿入を安全に行いますが、
テキスト比較は単純化され、バイナリデータを含むカラムについては
クエリの中で<literal>LIKE</literal>句を使用できません。
実際には、バイナリカラムでこのようなことをするスキーマにはしないの
で、これが問題になることはないでしょう。
(実際には、ファイルのような他の手段でバイナリデータを保存する方が良
いでしょう。)
</para>
<warning>
<simpara>
<function>addslashes</function>をSQLiteクエリの文字列をクオート
するために使用するべきではありません。さもないと、
データを取得する際に奇妙な結果を発生する可能性があります。
</simpara>
</warning>
<note>
<simpara>
この関数を
<function>sqlite_create_function</function>または
<function>sqlite_create_aggregate</function>により作成したUDFから
返す値をエンコードするために使用しないでください。
代わりに <function>sqlite_udf_encode_binary</function> を使用して
ください。
</simpara>
</note>
</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:"../../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
-->