mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 00:12:06 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@334678 c90b9560-bf6c-de11-be94-00142212c4b1
171 lines
5.0 KiB
XML
171 lines
5.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 49944c9148ba4e48c1aa96544cdec3911b2f4131 Maintainer: edwincartagenah Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xml:id='function.pg-delete' xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>pg_delete</refname>
|
|
<refpurpose>
|
|
Borra registros
|
|
</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>mixed</type><methodname>pg_delete</methodname>
|
|
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>table_name</parameter></methodparam>
|
|
<methodparam><type>array</type><parameter>assoc_array</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>options</parameter><initializer>PGSQL_DML_EXEC</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>pg_delete</function> Borra los registros de una tabla especificada por
|
|
las claves y los valores en <parameter>assoc_array</parameter>. Si <parameter>options</parameter> se
|
|
especifica, se aplica <function>pg_convert</function> a
|
|
<parameter>assoc_array</parameter> con las opciones especificadas.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>connection</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Recurso de conección a la base de datos PostgreSQL.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>table_name</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Nombre de la tabla de la cual se va a borrar las filas.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>assoc_array</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Un tipo <type>array</type> en los cuales están los nombres de los campos en la tabla <parameter>table_name</parameter>,
|
|
y cuyos valores son los valores de esos campos que están por ser borrados.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>options</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Cualquier número de <constant>PGSQL_CONV_FORCE_NULL</constant>,
|
|
<constant>PGSQL_DML_NO_CONV</constant>,
|
|
<constant>PGSQL_DML_ESCAPE</constant>,
|
|
<constant>PGSQL_DML_EXEC</constant>,
|
|
<constant>PGSQL_DML_ASYNC</constant> o
|
|
<constant>PGSQL_DML_STRING</constant> combinadas. Si <constant>PGSQL_DML_STRING</constant> es parte de
|
|
<parameter>options</parameter>, se devuelve el string de consulta. Cuando <constant>PGSQL_DML_NO_CONV</constant>
|
|
o <constant>PGSQL_DML_ESCAPE</constant> están establecidas, no se llama a <function>pg_convert</function> internamente.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success; Devuelve <type>string</type> si <constant>PGSQL_DML_STRING</constant> es pasada
|
|
por medio de <parameter>options</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo de la función <function>pg_delete</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$db = pg_connect('dbname=foo');
|
|
// Esta forma es segura, ya que $_POST se convierte automaticamente
|
|
$res = pg_delete($db, 'post_log', $_POST);
|
|
if ($res) {
|
|
echo "El dato POST será borrado: $res\n";
|
|
} else {
|
|
echo "El usuario debe haber enviado entradas incorrectas\n";
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>5.6.0</entry>
|
|
<entry>
|
|
Ya no es experimental. Se añadió la constante <constant>PGSQL_DML_ESCAPE</constant>,
|
|
se admiten los tipos de datos &true;/&false; y &null;.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>5.5.3/5.4.19</entry>
|
|
<entry>
|
|
La inyección SQL directa a <parameter>table_name</parameter> y la inyección SQL
|
|
indirecta a identificadores son fijasinjection.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>pg_convert</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
|
|
-->
|