New delete_records_select() function

This commit is contained in:
moodler
2003-04-27 06:18:03 +00:00
parent f9d5fd3b3c
commit 30f89d6833
+13
View File
@@ -542,6 +542,19 @@ function delete_records($table, $field1="", $value1="", $field2="", $value2="",
return $db->Execute("DELETE FROM $CFG->prefix$table $select");
}
function delete_records_select($table, $select="") {
/// Delete one or more records from a table
/// "select" is a fragment of SQL to define the selection criteria
global $CFG, $db;
if ($select) {
$select = "WHERE $select";
}
return $db->Execute("DELETE FROM $CFG->prefix$table $select");
}
function insert_record($table, $dataobject, $returnid=true) {
/// Insert a record into a table and return the "id" field if required