mirror of
https://github.com/php/doc-es.git
synced 2026-04-27 17:14:09 +02:00
0c607fccc5
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@336345 c90b9560-bf6c-de11-be94-00142212c4b1
161 lines
4.1 KiB
XML
161 lines
4.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 8a4247cc1b7daf4daaaec8701d46d1daa1c0b886 Maintainer: carlos Status: ready -->
|
|
<!-- Reviewed: yes Maintainer: seros -->
|
|
<refentry xml:id="function.mysql-escape-string" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>mysql_escape_string</refname>
|
|
<refpurpose>Escapa una cadena para ser usada en mysql_query</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsynopsisdiv>
|
|
<warning>
|
|
&mysql.alternative.note.4-3-0;
|
|
<simplelist role="alternatives">
|
|
<member><function>mysqli_escape_string</function></member>
|
|
<member><methodname>PDO::quote</methodname></member>
|
|
</simplelist>
|
|
</warning>
|
|
</refsynopsisdiv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mysql_escape_string</methodname>
|
|
<methodparam><type>string</type><parameter>unescaped_string</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Esta función escapará <parameter>unescaped_string</parameter>,
|
|
para que sea segura ponerla en una <function>mysql_query</function>.
|
|
Esta función está obsoleta.
|
|
</para>
|
|
<para>
|
|
Esta función es idéntica a <function>mysql_real_escape_string</function>
|
|
excepto que <function>mysql_real_escape_string</function> toma un
|
|
gestor de conexión y escapa la cadena de acuerdo con el juego de carácteres
|
|
actual. <function>mysql_escape_string</function> no toma un
|
|
argumento de conexión y no respeta la configuración del juego de caracteres actual.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>unescaped_string</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
La cadena que va a ser escapada.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve la cadena escapada.
|
|
</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.3.0</entry>
|
|
<entry>
|
|
Ahora, esta función lanza un aviso E_DEPRECATED.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>4.3.0</entry>
|
|
<entry>
|
|
Esta función será eliminada, no la utilice. En su lugar utilice
|
|
<function>mysql_real_escape_string</function>.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo de <function>mysql_escape_string</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$elemento = "Zak's Laptop";
|
|
$elemento_escapado = mysql_escape_string($elemento);
|
|
printf("Cadena escapada: %s\n", $elemento_escapado);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
Cadena escapada: Zak\'s Laptop
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<note>
|
|
<para>
|
|
<function>mysql_escape_string</function> no escapa los caracteres
|
|
<literal>%</literal> y <literal>_</literal>.
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>mysql_real_escape_string</function></member>
|
|
<member><function>addslashes</function></member>
|
|
<member>La directiva <link linkend="ini.magic-quotes-gpc">magic_quotes_gpc</link>.</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
|
|
-->
|