reference/dbase/functions/dbase-replace-record.xml
86e6094e86b84a51d00ab217ac50ce8dde33d82a
...
...
@@ -9,9 +9,9 @@
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
11
<type>bool</type><methodname>dbase_replace_record</methodname>
12
-
<methodparam><type>int</type><parameter>dbase_identifier</parameter></methodparam>
13
-
<methodparam><type>array</type><parameter>record</parameter></methodparam>
14
-
<methodparam><type>int</type><parameter>record_number</parameter></methodparam>
12
+
<methodparam><type>resource</type><parameter>database</parameter></methodparam>
13
+
<methodparam><type>array</type><parameter>data</parameter></methodparam>
14
+
<methodparam><type>int</type><parameter>number</parameter></methodparam>
15
15
</methodsynopsis>
16
16
<para>
17
17
Replaces the given record in the database with the given data.
...
...
@@ -22,16 +22,16 @@
22
22
<para>
23
23
<variablelist>
24
24
<varlistentry>
25
-
<term><parameter>dbase_identifier</parameter></term>
25
+
<term><parameter>database</parameter></term>
26
26
<listitem>
27
27
<para>
28
-
The database link identifier, returned by <function>dbase_open</function>
28
+
The database resource, returned by <function>dbase_open</function>
29
29
or <function>dbase_create</function>.
30
30
</para>
31
31
</listitem>
32
32
</varlistentry>
33
33
<varlistentry>
34
-
<term><parameter>record</parameter></term>
34
+
<term><parameter>data</parameter></term>
35
35
<listitem>
36
36
<para>
37
37
An indexed array of data. The number of items must be equal to the
...
...
@@ -47,7 +47,7 @@
47
47
</listitem>
48
48
</varlistentry>
49
49
<varlistentry>
50
-
<term><parameter>record_number</parameter></term>
50
+
<term><parameter>number</parameter></term>
51
51
<listitem>
52
52
<para>
53
53
An integer which spans from 1 to the number of records in the database
...
...
@@ -64,6 +64,30 @@
64
64
&return.success;
65
65
</para>
66
66
</refsect1>
67
+

68
+
<refsect1 role="changelog">
69
+
&reftitle.changelog;
70
+
<informaltable>
71
+
<tgroup cols="2">
72
+
<thead>
73
+
<row>
74
+
<entry>&Version;</entry>
75
+
<entry>&Description;</entry>
76
+
</row>
77
+
</thead>
78
+
<tbody>
79
+
<row>
80
+
<entry>dbase 7.0.0</entry>
81
+
<entry>
82
+
<parameter>database</parameter> is now a <type>resource</type>
83
+
instead of an <type>int</type>.
84
+
</entry>
85
+
</row>
86
+
</tbody>
87
+
</tgroup>
88
+
</informaltable>
89
+
</refsect1>
90
+

67
91
<refsect1 role="examples">
68
92
&reftitle.examples;
69
93
<para>
...
...
@@ -86,6 +110,9 @@ if ($db) {
86
110
// Update the date field with the current timestamp
87
111
$row['date'] = date('Ymd');
88
112
113
+
// convert the row to an indexed array
114
+
$row = array_values($row);
115
+

89
116
// Replace the record
90
117
dbase_replace_record($db, $row, 1);
91
118
dbase_close($db);
...
...
@@ -97,6 +124,21 @@ if ($db) {
97
124
</example>
98
125
</para>
99
126
</refsect1>
127
+

128
+
<refsect1 role="notes"><!-- {{{ -->
129
+
&reftitle.notes;
130
+
<note>
131
+
<para>
132
+
Boolean fields result in an <type>int</type> element value
133
+
(<literal>0</literal> or <literal>1</literal>) when retrieved via
134
+
<function>dbase_get_record</function> or
135
+
<function>dbase_get_record_with_names</function>. If they are written back,
136
+
this results in the value becoming <literal>0</literal>, so care has to be
137
+
taken to properly adjust the values.
138
+
</para>
139
+
</note>
140
+
</refsect1><!-- }}} -->
141
+

100
142
<refsect1 role="seealso">
101
143
&reftitle.seealso;
102
144
<para>
103
145