From f503ba10984bca0d8f82f8fa524be2868cc8c5c9 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sun, 10 Apr 2011 22:12:56 +0000 Subject: [PATCH] functions.inc.php, - db_delete(): if no row was deleted, return 0 (not true) This should not affect any existing code, but makes more sense for future usage. - whitespace changes in db_delete() git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1035 a1433add-5e2c-0410-b055-b7f2511e0802 --- functions.inc.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/functions.inc.php b/functions.inc.php index 8dfbf170..2ccc512c 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -1713,13 +1713,11 @@ function db_delete ($table,$where,$delete) $table = table_by_key($table); $query = "DELETE FROM $table WHERE " . escape_string($where) . "='" . escape_string($delete) . "'"; $result = db_query ($query); - if ($result['rows'] >= 1) - { + + if ($result['rows'] >= 1) { return $result['rows']; - } - else - { - return true; + } else { + return 0; } }