reference/dbase/functions/dbase-numrecords.xml
4754397753fd79f1c846868b66a2448babab1c54
...
...
@@ -9,13 +9,18 @@
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
11
<type>int</type><methodname>dbase_numrecords</methodname>
12
-
<methodparam><type>int</type><parameter>dbase_identifier</parameter></methodparam>
12
+
<methodparam><type>resource</type><parameter>database</parameter></methodparam>
13
13
</methodsynopsis>
14
14
<para>
15
15
Gets the number of records (rows) in the specified database.
16
16
</para>
17
17
<note>
18
18
<para>
19
+
Records which are marked as deleted are counted as well.
20
+
</para>
21
+
</note>
22
+
<note>
23
+
<para>
19
24
Record numbers are between 1 and <literal>dbase_numrecords($db)</literal>,
20
25
while field numbers are between 0 and <literal>dbase_numfields($db)-1</literal>.
21
26
</para>
...
...
@@ -26,10 +31,10 @@
26
31
<para>
27
32
<variablelist>
28
33
<varlistentry>
29
-
<term><parameter>dbase_identifier</parameter></term>
34
+
<term><parameter>database</parameter></term>
30
35
<listitem>
31
36
<para>
32
-
The database link identifier, returned by <function>dbase_open</function>
37
+
The database resource, returned by <function>dbase_open</function>
33
38
or <function>dbase_create</function>.
34
39
</para>
35
40
</listitem>
...
...
@@ -43,6 +48,30 @@
43
48
The number of records in the database, or &false; if an error occurs.
44
49
</para>
45
50
</refsect1>
51
+

52
+
<refsect1 role="changelog">
53
+
&reftitle.changelog;
54
+
<informaltable>
55
+
<tgroup cols="2">
56
+
<thead>
57
+
<row>
58
+
<entry>&Version;</entry>
59
+
<entry>&Description;</entry>
60
+
</row>
61
+
</thead>
62
+
<tbody>
63
+
<row>
64
+
<entry>dbase 7.0.0</entry>
65
+
<entry>
66
+
<parameter>database</parameter> is now a <type>resource</type>
67
+
instead of an <type>int</type>.
68
+
</entry>
69
+
</row>
70
+
</tbody>
71
+
</tgroup>
72
+
</informaltable>
73
+
</refsect1>
74
+

46
75
<refsect1 role="examples">
47
76
&reftitle.examples;
48
77
<para>
...
...
@@ -58,7 +87,12 @@ $db = dbase_open('/tmp/test.dbf', 0);
58
87
if ($db) {
59
88
$record_numbers = dbase_numrecords($db);
60
89
for ($i = 1; $i <= $record_numbers; $i++) {
61
-
// do something here, for each record
90
+
$record = dbase_get_record($db, $i);
91
+
if (!$record['deleted']) {
92
+
// do something with the $record
93
+
} else {
94
+
// do something with the deleted $record or ignore it
95
+
}
62
96
}
63
97
}
64
98

65
99