functions.inc.php:

- db_delete(): allow to specify additional conditions for the WHERE clause


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1285 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 13 years ago
parent 41d8bcaf0a
commit 3baf1a61c9

@ -1624,9 +1624,9 @@ function db_assoc ($result) {
// Action: Deletes a row from a specified table
// Call: db_delete (string table, string where, string delete)
//
function db_delete ($table,$where,$delete) {
function db_delete ($table,$where,$delete,$additionalwhere='') {
$table = table_by_key($table);
$query = "DELETE FROM $table WHERE " . escape_string($where) . "='" . escape_string($delete) . "'";
$query = "DELETE FROM $table WHERE " . escape_string($where) . "='" . escape_string($delete) . "' " . $additionalwhere;
$result = db_query ($query);
if ($result['rows'] >= 1) {

Loading…
Cancel
Save