mirror of
https://github.com/php/doc-es.git
synced 2026-03-24 07:22:16 +01:00
176 lines
4.7 KiB
XML
176 lines
4.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 0545e305cf06937b14b3f0694d6e716c9881ffd7 Maintainer: PhilDaiguille Status: ready -->
|
|
<!-- Reviewed: yes Maintainer: PhilDaiguille -->
|
|
|
|
<refentry xml:id="function.dbase-replace-record" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>dbase_replace_record</refname>
|
|
<refpurpose>Reemplaza un registro en una base dBase</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>dbase_replace_record</methodname>
|
|
<methodparam><type>resource</type><parameter>database</parameter></methodparam>
|
|
<methodparam><type>array</type><parameter>data</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>number</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Reemplaza el registro pasado en la base de datos con los datos proporcionados.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>database</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
El recurso de la base de datos, devuelto por
|
|
<function>dbase_open</function> o <function>dbase_create</function>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>data</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Un array indexado de datos. El número de elementos debe ser igual
|
|
al número de campos en la base de datos, de lo contrario la función
|
|
<function>dbase_replace_record</function> fallará.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Si se utiliza <function>dbase_get_record</function> para devolver el valor
|
|
de este argumento, no se olvide de reinicializar la clave nombrada
|
|
<literal>deleted</literal>.
|
|
</para>
|
|
</note>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>number</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Un entero entre 1 y el número total de registros en la
|
|
base de datos (como devuelto por la función
|
|
<function>dbase_numrecords</function>).
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>PECL dbase 7.0.0</entry>
|
|
<entry>
|
|
El argumento <parameter>database</parameter> es ahora
|
|
una <type>resource</type> en lugar de un <type>int</type>.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Actualización de un registro en una base de datos</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
// Apertura en modo lectura-escritura
|
|
$db = dbase_open('/tmp/test.dbf', 2);
|
|
|
|
if ($db) {
|
|
// Recuperación de la antigua fila
|
|
$row = dbase_get_record_with_names($db, 1);
|
|
|
|
// Elimina la entrada borrada
|
|
unset($row['deleted']);
|
|
|
|
// Actualización de la fecha del campo con el timestamp actual
|
|
$row['date'] = date('Ymd');
|
|
|
|
// Reemplazar el registro
|
|
dbase_replace_record($db, $row, 1);
|
|
dbase_close($db);
|
|
}
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes"><!-- {{{ -->
|
|
&reftitle.notes;
|
|
<note>
|
|
<para>
|
|
Los resultados de los campos &boolean; son elementos de valor de tipo &integer;
|
|
(<literal>0</literal> o <literal>1</literal>) cuando se recuperan mediante
|
|
<function>dbase_get_record</function> o
|
|
<function>dbase_get_record_with_names</function>. Si se reescriben,
|
|
esto hará que el valor se convierta en <literal>0</literal>, por lo que se deben
|
|
tomar precauciones para ajustar correctamente los valores.
|
|
</para>
|
|
</note>
|
|
</refsect1><!-- }}} -->
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>dbase_add_record</function></member>
|
|
<member><function>dbase_delete_record</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
|
|
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
|
|
-->
|