mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-23 22:52:12 +01:00
140 lines
3.7 KiB
XML
140 lines
3.7 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!-- EN-Revision: 0545e305cf06937b14b3f0694d6e716c9881ffd7 Maintainer: leonardolara Status: ready --><!-- CREDITS: fernandoc,leonardolara -->
|
|
<refentry xml:id="function.dbase-get-record-with-names" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>dbase_get_record_with_names</refname>
|
|
<refpurpose>
|
|
Obtém um registro do banco de dados como um array associativo.
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>dbase_get_record_with_names</methodname>
|
|
<methodparam><type>resource</type><parameter>database</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>number</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Obtém um registro do banco de dados como um array associativo.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>database</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Recurso de banco de dados, retornado por <function>dbase_open</function>
|
|
ou <function>dbase_create</function>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>number</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
O índice do registro entre <literal>1</literal> e
|
|
<literal>dbase_numrecords($dbase_identifier)</literal>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Um array associativo com o registro. Isto também irá incluir uma chave chamada
|
|
<literal>deleted</literal> a qual é definida como 1 se o registro foi marcado
|
|
para exclusão (veja <function>dbase_delete_record</function>).
|
|
Portanto, não é possível obter o valor de um campo com nome
|
|
<literal>deleted</literal> com esta função.
|
|
</para>
|
|
&dbase.type-conversion;
|
|
<para>
|
|
Em caso de erro, <function>dbase_get_record_with_names</function> irá retornar &false;.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>PECL dbase 7.0.0</entry>
|
|
<entry>
|
|
<parameter>database</parameter> agora é do tipo <type>resource</type>
|
|
ao invés de <type>int</type>.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Listando todos os membros registrados no banco de dados</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// open in read-only mode
|
|
$db = dbase_open('/tmp/test.dbf', 0);
|
|
|
|
if ($db) {
|
|
$record_numbers = dbase_numrecords($db);
|
|
for ($i = 1; $i <= $record_numbers; $i++) {
|
|
$row = dbase_get_record_with_names($db, $i);
|
|
if ($row['ismember'] == 1) {
|
|
echo "Member #$i: " . trim($row['name']) . "\n";
|
|
}
|
|
}
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>dbase_get_record</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
|
|
-->
|