X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fdata_checks.inc;h=295a353e1203d2ec1cc484291803d9e8113f7fe7;hb=510d6e1925c4d1621ae3efd85e117cc9bb4320f0;hp=8e03d5849567ff107b12d1e3029ea537b0750ddb;hpb=2383d33373d6ddec06906658a0ed6398077c1147;p=fa-stable.git diff --git a/includes/data_checks.inc b/includes/data_checks.inc index 8e03d584..295a353e 100644 --- a/includes/data_checks.inc +++ b/includes/data_checks.inc @@ -428,6 +428,22 @@ function db_has_quick_entries() return check_empty_result("SELECT COUNT(*) FROM ".TB_PREF."quick_entries"); } +function db_has_tags($type) +{ + return check_empty_result("SELECT COUNT(*) FROM ".TB_PREF."tags WHERE type=$type"); +} + +function check_db_has_tags($type, $msg) +{ + global $path_to_root; + if (!db_has_tags($type)) + { + display_error($msg, true); + end_page(); + exit; + } +} + function check_empty_result($sql) { $result = db_query($sql, "could not do check empty query");