mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-26 18:02:17 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@289197 c90b9560-bf6c-de11-be94-00142212c4b1
147 lines
4.0 KiB
XML
147 lines
4.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: af4410a7e15898c3dbe83d6ea38246745ed9c6fb Maintainer: dams Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<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>Lie la valeur d'un paramètre à une variable de requête</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>
|
|
Lie la valeur d'un paramètre à une variable de requête.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>sql_param</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Un &string; identifiant la variable de requête sur laquelle la valeur
|
|
doit être liée.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>value</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
La valeur à lier à la variable de requête.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>type</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Le type de données de la valeur à lier.
|
|
<itemizedlist>
|
|
<listitem>
|
|
<para>
|
|
<literal>SQLITE3_INTEGER</literal> : La valeur est un entier signé,
|
|
stocké sur 1, 2, 3, 4, 6, ou 8 octets, suivant la grandeur de la valeur.
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
<literal>SQLITE3_FLOAT</literal> : La valeur est un nombre à virgule
|
|
flottante, stocké sur 8 octets.
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
<literal>SQLITE3_TEXT</literal> : La valeur est un texte, stocké
|
|
en utilisant l'encodage de la base de données
|
|
(UTF-8, UTF-16BE ou UTF-16-LE).
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
<literal>SQLITE3_BLOB</literal> : La valeur est un BLOB, stocké
|
|
exactement de la façon dont il a été fourni.
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
<literal>SQLITE3_NULL</literal> : La valeur est la valeur NULL.
|
|
</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retourne &true; si la valeur a été liée à la variable de requête, &false; si
|
|
une erreur survient.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <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
|
|
-->
|