NAME
DBX::Recordset - abstracts a DBX query result
SYNOPSIS
use DBX;
$conn = DBX->mysql("database=test;host=localhost;", "", "");
$rs = $conn->query("SELECT * FROM test");
while($rs)
{
print $rs->field("client") . "\n";
$rs->field("client", "test");
$rs->move_next;
}
DESCRIPTION
DBX::Recordset is the heart of the DBX and provides most of its additional functionality. Recordsets are returned by the query method of a DBX::Connection object.
Recordsets support simple forward-only cursors (at the moment) and allow you to easily retrieve and/or modify fields.
- eof
-
Returns a value indicating whether or not the recordset has reached its end. DBX::Recordset overrides the numification operator so that
if($rs)
is equivalent toif($rs-
eof)>. - field(NAME [, VALUE])
-
The field subroutine will return the value of the field named NAME. If a second parameter is passed, then the field with that name will be set to that value. Note that changes made with the field function don't take effect until update() is called or the cursor moves.
- move_first
-
Moves the recordset's cursor to the beginning of the set. Works only for random-access cursors. NOT YET IMPLEMENTED.
- move_prev
-
Moves the recordset's cursor to the previous record. Works only for random-access cursors. NOT YET IMPLEMENTED.
- move_next
-
Moves the recordset's cursor to the next record. Works for random-access and forward-only cursors. If the recordset has reached its end, the EOF flag will be set.
- move_last
-
Moves the recordset's cursor to the end of the set. Works only for random-access cursors. NOT YET IMPLEMENTED.
- update
-
Saves changes to the current record.
update
is automatically called when the cursor is moved.
DEPENDENCIES
Requires DBX and all of its dependencies
SEE ALSO
AUTHOR
Bill Atkins, <dbxNOSPAM@batkins.com>
COPYRIGHT AND LICENSE
Copyright 2003 by Bill Atkins
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.