mirror of
https://github.com/php/doc-ja.git
synced 2026-03-27 08:32:09 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@288881 c90b9560-bf6c-de11-be94-00142212c4b1
145 lines
4.0 KiB
XML
145 lines
4.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: af4410a7e15898c3dbe83d6ea38246745ed9c6fb Maintainer: takagi Status: ready -->
|
|
|
|
<refentry xml:id="sqlite3stmt.bindvalue" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>SQLite3Stmt::bindValue</refname>
|
|
<refpurpose>パラメータの値を変数にバインドする</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type>bool</type><methodname>SQLite3Stmt::bindValue</methodname>
|
|
<methodparam><type>string</type><parameter>sql_param</parameter></methodparam>
|
|
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>type</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
パラメータの値を変数にバインドします。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>sql_param</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
値をどの変数にバインドするかを表す文字列。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>value</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
変数にバインドする値。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>type</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
バインドする値のデータ型。
|
|
<itemizedlist>
|
|
<listitem>
|
|
<para>
|
|
<literal>SQLITE3_INTEGER</literal>: 符号付き整数。
|
|
値の大きさに応じて 1, 2, 3, 4, 6, あるいは 8 バイトで格納されます。
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
<literal>SQLITE3_FLOAT</literal>: 浮動小数点数値。
|
|
8 バイトの IEEE 浮動小数点数値として格納されます。
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
<literal>SQLITE3_TEXT</literal>: テキスト文字列。
|
|
データベースのエンコーディング (UTF-8, UTF-16BE あるいは UTF-16-LE)
|
|
を用いて格納されます。
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
<literal>SQLITE3_BLOB</literal>: blob データ。
|
|
入力がそのままの形式で格納されます。
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
<literal>SQLITE3_NULL</literal>: NULL 値。
|
|
</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
値を変数にバインドした場合に &true;、
|
|
失敗した場合に &false; を返します。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>SQLite3Stmt::bindValue</function> の例</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
unlink('mysqlitedb.db');
|
|
$db = new SQLite3('mysqlitedb.db');
|
|
|
|
$db->exec('CREATE TABLE foo (id INTEGER, bar STRING)');
|
|
$db->exec("INSERT INTO foo (id, bar) VALUES (1, 'This is a test')");
|
|
|
|
$stmt = $db->prepare('SELECT bar FROM foo WHERE id=:id');
|
|
$stmt->bindValue(':id', 1, SQLITE3_INTEGER);
|
|
|
|
$result = $stmt->execute();
|
|
var_dump($result->fetchArray());
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|