A "TableRS" is an editable RS which is associated with a table in
a DB. After editing this RS, the programer can save the changes
back to DB. For example:
//open the recordset
$fld_list = "field1, field2, field3"; //optional, default "*"
$condition = "... AND ... OR ..."; //SQL WHERE condition, optional
$rs = new TableRS("tbl_name", $fld_list, $condition);
//make some changes to the recordset
$rs->MoveNext();
$rs->rmRec(); //remove the second record
$rs->find("field1='$value'");
do
{
$rs->setFld("field2", $value2);
}
while ($rs->find_next());
$rs->MoveLast();
$rec = array("field1"=>$val1, "field2"=>$val2, "field3"=>$val3);
$rs->addRec($rec);
//save in the DB table all the changes made to the recordset
$rs->save();
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A "TableRS" is an editable RS which is associated with a table in
a DB. After editing this RS, the programer can save the changes
back to DB. For example:
//open the recordset
$fld_list = "field1, field2, field3"; //optional, default "*"
$condition = "... AND ... OR ..."; //SQL WHERE condition, optional
$rs = new TableRS("tbl_name", $fld_list, $condition);
//make some changes to the recordset
$rs->MoveNext();
$rs->rmRec(); //remove the second record
$rs->find("field1='$value'");
do
{
$rs->setFld("field2", $value2);
}
while ($rs->find_next());
$rs->MoveLast();
$rec = array("field1"=>$val1, "field2"=>$val2, "field3"=>$val3);
$rs->addRec($rec);
//save in the DB table all the changes made to the recordset
$rs->save();