From 3baf1a61c990b617dbefbd1a9b6f63042c275680 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sun, 27 Nov 2011 21:24:29 +0000 Subject: [PATCH] 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 --- functions.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions.inc.php b/functions.inc.php index c7e311da..33dd07ba 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -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) {