Files
doc-fr/reference/pgsql/functions/pg-get-notify.xml
Damien Seguy 14a38b9fd1 massive typos chase
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@162926 c90b9560-bf6c-de11-be94-00142212c4b1
2004-07-09 20:26:31 +00:00

76 lines
2.2 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- EN-Revision: 1.7 Maintainer: yannick Status: ready -->
<refentry id="function.pg-get-notify">
<refnamediv>
<refname>pg_get_notify</refname>
<refpurpose>Lit le message de <literal>NOTIFY</literal></refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>pg_get_notify</methodname>
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam>
</methodsynopsis>
<para>
<function>pg_get_notify</function> reçoit le message de NOTIFY envoyé
par une commande SQL <literal>NOTIFY</literal>. Pour lire le message
associé, utilisez la commande <literal>LISTEN</literal>. S'il y a
un message de notification avec cette connexion, un tableau sera retourné
avec le message et l'identifiant de processus du serveur. S'il n'y a pas de message,
<function>pg_get_notify</function> retourne &false;.
</para>
<para>
<example>
<title>Exemple avec <function>pg_get_notify</function></title>
<programlisting role="php">
<![CDATA[
<?php
$conn = pg_pconnect("dbname=publisher");
if (!$conn) {
echo "Une erreur est survenue.\n";
exit;
}
// ecoute le message 'author_updated' des autres processus
pg_query($conn, 'LISTEN author_updated;');
$notify = pg_get_notify($conn);
if (!$notify) {
echo "Aucun message\n";
} else {
print_r($notify);
}
?>
]]>
</programlisting>
</example>
</para>
<para>
Voir aussi
<function>pg_get_pid</function>.
</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:"../../../../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
-->