1
0
mirror of https://github.com/php/doc-ru.git synced 2026-04-27 01:08:05 +02:00
Files
Mikhail Alferov 1de5525231 Update e2f2172 to En (#1242)
* Update functions.xml to en

* Update paamayim-nekudotayim.xml to en

* Update variant-cmp.xml

* Update cubrid-fetch-field.xml to en

* Update createfromformat.xml to en

* Update dio-open.xml to en + уточнил перевод

* Update evtimer.xml to en

* Update fann-create-train-from-callback.xml to en

* Update fann-create-train.xml to en

* Update fann-create-train.xml to en

* Update constants.xml to en

* Update gnupg-init.xml to en

* Update ini.xml to en

* Update constants.xml to en

* Update error-list.xml to en

* Update openssl-pkcs12-read.xml to en

* Update examples.xml to en

* Update ini.xml to en

* Update ini.xml

* Update reference.xml to en

* pg-escape-identifier.xml to En + уточнил перевод

* Update isrunning.xml to en

* Update isrunning.xml

* Update random.engine.xml to en

* generate.xml to en + уточнил перевод, добавил пропуски

* Update get.xml to en

* Update getnext.xml to en

* Update socket-addrinfo-lookup.xml to en

* Update sodium-crypto-box-publickey-from-secretkey.xml to en

* Update solrdocument.xml to en

* Update construct.xml to en

* Update connect.xml to en

* Update odbc-field-num.xml to en

* Update odbc-field-scale.xml to en

* Update wincache-ucache-add.xml to en

* Update wincache-ucache-set.xml to en

* Update wincache-ucache-add.xml

* Update ini.xml to en

* Update yaf-route-static.xml to en

* Update get.xml to en

* registerlocalnamespace.xml

Временно изменил тип возврата и секцию Return. Ну как фиксировать настолько противоречивые данные: в сигнатуре возврат `void`, в секции возврата: bool. Читатель не виноват

* Update registernamespace.xml to en

* Update getbody.xml to en

* Update setheader.xml to en

* Update construct.xml to en + уточнил перевод, CS

* Update setscriptpath.xml to en

* Update call.xml to en

* Update call.xml

* Update delete.xml to en

* Update registerlocalnamespace.xml

* Update delete.xml

* Update ini.xml Remove extra spaces
2026-04-14 18:57:27 +03:00

130 lines
4.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: e2f2172bf114599926878017ab2dce356956fa9e Maintainer: rjhdby Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id='function.pg-escape-identifier' xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>pg_escape_identifier</refname>
<refpurpose>
Экранирует идентификатор перед вставкой в текст SQL-инструкции
</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>pg_escape_identifier</methodname>
<methodparam choice="opt"><type>PgSql\Connection</type><parameter>connection</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
</methodsynopsis>
<para>
Функция <function>pg_escape_identifier</function> экранирует названия таблиц, полей и других идентификаторов в SQL-инструкциях
перед отправкой запроса к базе данных. Функция <function>pg_escape_identifier</function> экранирует идентификаторы
по правилам PostgreSQL-сервера — обрамляет двойными кавычками — и возвращает заэкранированную строку.
Оставлять в SQL-инструкции незаэкранированные идентификаторы или добавлять двойные кавычки вручную — небезопасно.
Строковые, числовые, логические и другие SQL-литералы внутри инструкции, кроме типа bytea,
экранируют функцией <function>pg_escape_literal</function> или <function>pg_escape_string</function>.
Поля с типом bytea экранируют функцией <function>pg_escape_bytea</function>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>connection</parameter></term>
<listitem>
&pgsql.parameter.connection-with-unspecified-default;
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>data</parameter></term>
<listitem>
<para>
Текстовая строка (<type>string</type>), которую требуется заэкранировать.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Функция возвращает строку (<type>string</type>) с заэкранированными данными.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
&pgsql.changelog.connection-object;
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Пример экранирования идентификатора функцией <function>pg_escape_identifier</function></title>
<programlisting role="php">
<![CDATA[
<?php
// Устанавливаем соединение с базой данных
$dbconn = pg_connect('dbname=foo');
// Экранируем название таблицы
$escaped = pg_escape_identifier($table_name);
// Выбираем строки из таблицы $table_name
pg_query("SELECT * FROM {$escaped};");
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>pg_escape_literal</function></member>
<member><function>pg_escape_bytea</function></member>
<member><function>pg_escape_string</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
-->