1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-26 00:12:06 +01:00
Files
archived-doc-es/reference/sqlite3/sqlite3stmt/bindvalue.xml
Pedro Antonio Gil Rodríguez 61c55642b3 Translation
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@318766 c90b9560-bf6c-de11-be94-00142212c4b1
2011-11-04 10:08:39 +00:00

147 lines
4.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: af4410a7e15898c3dbe83d6ea38246745ed9c6fb Maintainer: seros 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>Vincular el valor de un parámetro a una variable de sentencia</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>
Vincula el valor de un parámetro a una variable de sentencia.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>sql_param</parameter></term>
<listitem>
<para>
Un <type>string</type> que identifica la variable de sentencia a la que el
valor debería ser vinculado.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>value</parameter></term>
<listitem>
<para>
El valor a vincular a la variable de sentencia.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>type</parameter></term>
<listitem>
<para>
El tipo de dato de la variable a vincular.
<itemizedlist>
<listitem>
<para>
<literal>SQLITE3_INTEGER</literal>: El valor es un entero con signo,
almacenado en 1, 2, 3, 4, 6, u 8 bytes, dependiendo de la magnitud del
valor.
</para>
</listitem>
<listitem>
<para>
<literal>SQLITE3_FLOAT</literal>: El valor es de tipo coma
flotante, almacenado como un número de coma flotante IEEE de 8 bytes.
</para>
</listitem>
<listitem>
<para>
<literal>SQLITE3_TEXT</literal>: El valor es una cadena de texto, almacenado
usando la codificación de la base de datos (UTF-8, UTF-16BE o UTF-16-LE).
</para>
</listitem>
<listitem>
<para>
<literal>SQLITE3_BLOB</literal>: El valor es de tipo blob, almacenado
exactamente a como fue insertado.
</para>
</listitem>
<listitem>
<para>
<literal>SQLITE3_NULL</literal>: El valor es NULL.
</para>
</listitem>
</itemizedlist>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Devuelve &true; si el valor es vinculado a la variable de sentencia, &false;
en case de error.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Ejemplo de <function>SQLite3Stmt::bindValue</function></title>
<programlisting role="php">
<![CDATA[
<?php
unlink('mibdsqlite.db');
$bd = new SQLite3('mibdsqlite.db');
$bd->exec('CREATE TABLE foo (id INTEGER, bar STRING)');
$bd->exec("INSERT INTO foo (id, bar) VALUES (1, 'Esto es una prueba')");
$sentencia = $bd->prepare('SELECT bar FROM foo WHERE id=:id');
$sentencia->bindValue(':id', 1, SQLITE3_INTEGER);
$resultado = $sentencia->execute();
var_dump($resultado->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
-->