diff options
author | Andrew Dolgov <[email protected]> | 2006-03-21 08:09:18 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2006-03-21 08:09:18 +0100 |
commit | 894ebcf5e94c917f5e10e5196f74b8055e2b2407 (patch) | |
tree | a6ae843d7622de23a464e43b00942fdf00a27006 /functions.php | |
parent | ac92cb46be4fad924be5e03f46fed7000c3dea81 (diff) |
update_daemon work, remove unneeded indexes, query optimizations
Diffstat (limited to 'functions.php')
-rw-r--r-- | functions.php | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/functions.php b/functions.php index dcda35ece..988369c32 100644 --- a/functions.php +++ b/functions.php @@ -1,10 +1,10 @@ <? - if ($_GET["debug"]) { +/* if ($_GET["debug"]) { define('DEFAULT_ERROR_LEVEL', E_ALL); } else { define('DEFAULT_ERROR_LEVEL', E_ERROR | E_WARNING | E_PARSE); - } + } */ require_once 'config.php'; require_once 'db-prefs.php'; @@ -56,11 +56,7 @@ function global_purge_old_posts($link, $do_output = false, $limit = false) { - if (DB_TYPE == "mysql") { - $random_qpart = "RAND()"; - } else { - $random_qpart = "RANDOM()"; - } + $random_qpart = sql_random_function(); if ($limit) { $limit_qpart = "LIMIT $limit"; @@ -1044,4 +1040,12 @@ } } + function sql_random_function() { + if (DB_TYPE == "mysql") { + return "RAND()"; + } else { + return "RANDOM()"; + } + } + ?> |