RecordSet::delete - jcobban/Genealogy GitHub Wiki

$recordSet->delete($xml)

Up: class RecordSet

This method deletes all of the records in the set and returns the number of records deleted. If any unusual data is encountered it is reported by adding a message to $warn. A specific case is if the RecordSet applies to the complete table, that is the second parameter was omitted or explicitly specified as null in the constructor. This is rejected to prevent accidentally deleting the entire table. The parameters for this constructor are:

parameter description
$xml If boolean true or a string generate XML output to standard output. If a string then it is used to name the root tag, otherwise the root tag is <cmd>.

The following would delete all name records with surname 'Smith':

$smiths	     = new RecordSet('Names', array('surname' => 'Smith'));
$smiths->delete();

Next: $recordSet->update($setparms, $xml, $simulate, $order)

⚠️ **GitHub.com Fallback** ⚠️