mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-04-26 01:58:13 +02:00
ae904013d7
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@164386 c90b9560-bf6c-de11-be94-00142212c4b1
98 lines
2.5 KiB
XML
98 lines
2.5 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.7 $ -->
|
|
<!-- EN-Revision: 1.8 Maintainer: yannick Status: ready -->
|
|
<refentry id="function.pg-fetch-row">
|
|
<refnamediv>
|
|
<refname>pg_fetch_row</refname>
|
|
<refpurpose>Lit une ligne dans un tableau</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>pg_fetch_row</methodname>
|
|
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>row</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>pg_fetch_row</function> lit une ligne dans le résultat
|
|
associé à l'index <parameter>result</parameter>. La ligne est
|
|
retournée sous la forme d'un tableau. La ligne est retournée
|
|
sous la forme d'un tableau, qui commence à l'index 0.
|
|
</para>
|
|
<para>
|
|
Les appels ultérieurs à <function>pg_fetch_row</function>
|
|
retourneront la ligne d'après, ou bien &false;,
|
|
lorsqu'il n'y aura plus de lignes.
|
|
</para>
|
|
&database.fetch-null;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>pg_fetch_row</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$conn = pg_pconnect("dbname=publisher");
|
|
if (!$conn) {
|
|
echo "Une erreur est survenue.\n";
|
|
exit;
|
|
}
|
|
|
|
$result = pg_query($conn, "SELECT * FROM authors");
|
|
if (!$result) {
|
|
echo "Une erreur est survenue.\n";
|
|
exit;
|
|
}
|
|
|
|
while ($row = pg_fetch_row($result, $i)) {
|
|
for ($j=0; $j < count($row); $j++) {
|
|
echo $row[$j] . " ";
|
|
}
|
|
|
|
echo "<br />\n";
|
|
|
|
}
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Depuis &php; 4.1.0, <parameter>row</parameter> est
|
|
devenu un paramètre optionnel.
|
|
Appeler <function>pg_fetch_row</function> incrémentera
|
|
le pointeur interne de résultat de 1.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
Voir aussi
|
|
<function>pg_query</function>,
|
|
<function>pg_fetch_array</function>,
|
|
<function>pg_fetch_object</function> et
|
|
<function>pg_fetch_result</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
|
|
-->
|